aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/account.php3
-rw-r--r--include/attach.php10
-rw-r--r--include/auth.php5
-rw-r--r--include/connections.php1
-rw-r--r--include/features.php13
-rw-r--r--include/import.php5
-rw-r--r--include/text.php2
7 files changed, 32 insertions, 7 deletions
diff --git a/include/account.php b/include/account.php
index 40cf281c3..2b24364f4 100644
--- a/include/account.php
+++ b/include/account.php
@@ -23,6 +23,7 @@ function get_account_by_id($account_id) {
function check_account_email($email) {
+ $email = punify($email);
$result = array('error' => false, 'message' => '');
// Caution: empty email isn't counted as an error in this function.
@@ -139,7 +140,7 @@ function create_account($arr) {
$result = array('success' => false, 'email' => '', 'password' => '', 'message' => '');
$invite_code = ((x($arr,'invite_code')) ? notags(trim($arr['invite_code'])) : '');
- $email = ((x($arr,'email')) ? notags(trim($arr['email'])) : '');
+ $email = ((x($arr,'email')) ? notags(punify(trim($arr['email']))) : '');
$password = ((x($arr,'password')) ? trim($arr['password']) : '');
$password2 = ((x($arr,'password2')) ? trim($arr['password2']) : '');
$parent = ((x($arr,'parent')) ? intval($arr['parent']) : 0 );
diff --git a/include/attach.php b/include/attach.php
index 39269eb03..363005029 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -948,6 +948,16 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
return $ret;
}
+ // Update the folder timestamp @todo recurse to the storage root folder
+
+ if($folder_hash) {
+ q("UPDATE attach set edited = '%s' where hash = '%s' and uid = %d and is_dir = 1",
+ dbesc($edited),
+ dbesc($folder_hash),
+ intval($channel_id)
+ );
+ }
+
// Caution: This re-uses $sql_options set further above
$r = q("select * from attach where uid = %d and hash = '%s' $sql_options limit 1",
diff --git a/include/auth.php b/include/auth.php
index 6f5e58361..844566919 100644
--- a/include/auth.php
+++ b/include/auth.php
@@ -37,6 +37,7 @@ require_once('include/security.php');
function account_verify_password($login, $pass) {
$ret = [ 'account' => null, 'channel' => null, 'xchan' => null ];
+ $login = punify($login);
$email_verify = get_config('system', 'verify_email');
$register_policy = get_config('system', 'register_policy');
@@ -235,7 +236,7 @@ else {
$record = null;
$addon_auth = array(
- 'username' => trim($_POST['username']),
+ 'username' => punify(trim($_POST['username'])),
'password' => trim($_POST['password']),
'authenticated' => 0,
'user_record' => null
@@ -261,7 +262,7 @@ else {
$verify = account_verify_password($_POST['username'], $_POST['password']);
if($verify && array_key_exists('reason',$verify) && $verify['reason'] === 'unvalidated') {
notice( t('Email validation is incomplete. Please check your email.'));
- goaway(z_root() . '/email_validation/' . bin2hex(trim(escape_tags($_POST['username']))));
+ goaway(z_root() . '/email_validation/' . bin2hex(punify(trim(escape_tags($_POST['username'])))));
}
elseif($verify) {
$atoken = $verify['xchan'];
diff --git a/include/connections.php b/include/connections.php
index c5d74d4ca..8d1b9e07f 100644
--- a/include/connections.php
+++ b/include/connections.php
@@ -100,7 +100,6 @@ function vcard_from_xchan($xchan, $observer = null, $mode = '') {
if(! $xchan)
return;
-// FIXME - show connect button to observer if appropriate
$connect = false;
if(local_channel()) {
$r = q("select * from abook where abook_xchan = '%s' and abook_channel = %d limit 1",
diff --git a/include/features.php b/include/features.php
index 993266977..5481c37a4 100644
--- a/include/features.php
+++ b/include/features.php
@@ -28,8 +28,9 @@ function get_feature_default($feature) {
$f = get_features(false);
foreach($f as $cat) {
foreach($cat as $feat) {
- if(is_array($feat) && $feat[0] === $feature)
+ if(is_array($feat) && $feat[0] === $feature) {
return $feat[3];
+ }
}
}
return false;
@@ -45,6 +46,7 @@ function feature_level($feature,$def) {
function get_features($filtered = true) {
+ $account = \App::get_account();
$arr = [
@@ -53,7 +55,14 @@ function get_features($filtered = true) {
t('General Features'),
-
+ [
+ 'start_menu',
+ t('New Member Links'),
+ t('Display new member quick links menu'),
+ (($account['account_created'] > datetime_convert('','','now - 60 days')) ? true : false),
+ get_config('feature_lock','start_menu'),
+ feature_level('start_menu',1),
+ ],
[
'advanced_profiles',
diff --git a/include/import.php b/include/import.php
index 9920df8be..d8b7030b6 100644
--- a/include/import.php
+++ b/include/import.php
@@ -21,6 +21,11 @@ function import_channel($channel, $account_id, $seize) {
$channel['channel_removed'] = (($channel['channel_pageflags'] & 0x8000) ? 1 : 0);
}
+ if(intval($channel['channel_removed'])) {
+ notice( t('Unable to import a removed channel.') . EOL);
+ return false;
+ }
+
// Ignore the hash provided and re-calculate
$channel['channel_hash'] = make_xchan_hash($channel['channel_guid'],$channel['channel_guid_sig']);
diff --git a/include/text.php b/include/text.php
index c1e064857..f9cefd020 100644
--- a/include/text.php
+++ b/include/text.php
@@ -1491,7 +1491,7 @@ function format_hashtags(&$item) {
$term = htmlspecialchars($t['term'], ENT_COMPAT, 'UTF-8', false) ;
if(! trim($term))
continue;
- if(strpos($item['body'], $t['url']))
+ if($t['url'] && strpos($item['body'], $t['url']))
continue;
if($s)
$s .= ' ';