aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormrjive <mrjive@mrjive.it>2018-03-29 17:47:50 +0200
committerGitHub <noreply@github.com>2018-03-29 17:47:50 +0200
commit20ac91703d54679d2e5080ba2d4985e93986a515 (patch)
treedca933ae97c7eeaf855d8522163e989317ce918f
parentc98776923a3aed4a0a17ca1412787de3b718eba9 (diff)
parente06e64823fbecbe67bcf59897ecad6b9c402744e (diff)
downloadvolse-hubzilla-20ac91703d54679d2e5080ba2d4985e93986a515.tar.gz
volse-hubzilla-20ac91703d54679d2e5080ba2d4985e93986a515.tar.bz2
volse-hubzilla-20ac91703d54679d2e5080ba2d4985e93986a515.zip
Merge pull request #1 from redmatrix/dev
Dev
-rw-r--r--Zotlabs/Module/Display.php10
-rw-r--r--Zotlabs/Module/Rpost.php4
-rw-r--r--Zotlabs/Module/Uexport.php4
-rw-r--r--Zotlabs/Widget/Newmember.php12
-rwxr-xr-xboot.php12
-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
-rw-r--r--view/js/autocomplete.js1
-rw-r--r--view/pdl/mod_display.pdl3
14 files changed, 57 insertions, 28 deletions
diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php
index fa29ce66c..d3047bc59 100644
--- a/Zotlabs/Module/Display.php
+++ b/Zotlabs/Module/Display.php
@@ -102,7 +102,7 @@ class Display extends \Zotlabs\Web\Controller {
if($decoded)
$item_hash = $decoded;
- $r = q("select id, uid, mid, parent_mid, thr_parent, verb, item_type, item_deleted, item_blocked from item where mid like '%s' limit 1",
+ $r = q("select id, uid, mid, parent_mid, thr_parent, verb, item_type, item_deleted, author_xchan, item_blocked from item where mid like '%s' limit 1",
dbesc($item_hash . '%')
);
@@ -110,6 +110,13 @@ class Display extends \Zotlabs\Web\Controller {
$target_item = $r[0];
}
+ $x = q("select * from xchan where xchan_hash = '%s' limit 1",
+ dbesc($target_item['author_xchan'])
+ );
+ if($x) {
+ \App::$poi = $x[0];
+ }
+
//if the item is to be moderated redirect to /moderate
if($target_item['item_blocked'] == ITEM_MODERATED) {
goaway(z_root() . '/moderate/' . $target_item['id']);
@@ -169,6 +176,7 @@ class Display extends \Zotlabs\Web\Controller {
}
}
+
$static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0);
diff --git a/Zotlabs/Module/Rpost.php b/Zotlabs/Module/Rpost.php
index e6ea52845..f0c4a06b9 100644
--- a/Zotlabs/Module/Rpost.php
+++ b/Zotlabs/Module/Rpost.php
@@ -45,7 +45,9 @@ class Rpost extends \Zotlabs\Web\Controller {
$url = get_rpost_path(\App::get_observer());
// make sure we're not looping to our own hub
if(($url) && (! stristr($url, \App::get_hostname()))) {
- foreach($_REQUEST as $key => $arg) {
+ foreach($_GET as $key => $arg) {
+ if($key === 'q')
+ continue;
$url .= '&' . $key . '=' . $arg;
}
goaway($url);
diff --git a/Zotlabs/Module/Uexport.php b/Zotlabs/Module/Uexport.php
index 28c840ceb..9af1887dc 100644
--- a/Zotlabs/Module/Uexport.php
+++ b/Zotlabs/Module/Uexport.php
@@ -22,8 +22,8 @@ class Uexport extends \Zotlabs\Web\Controller {
$month = intval(argv(2));
}
- header('content-type: application/octet_stream');
- header('content-disposition: attachment; filename="' . $channel['channel_address'] . (($year) ? '-' . $year : '') . (($month) ? '-' . $month : '') . '.json"' );
+ header('content-type: application/json');
+ header('content-disposition: attachment; filename="' . $channel['channel_address'] . (($year) ? '-' . $year : '') . (($month) ? '-' . $month : '') . (($_REQUEST['sections']) ? '-' . $_REQUEST['sections'] : '') . '.json"' );
if($year) {
echo json_encode(identity_export_year(local_channel(),$year,$month));
diff --git a/Zotlabs/Widget/Newmember.php b/Zotlabs/Widget/Newmember.php
index afa808e6f..1a4b575b9 100644
--- a/Zotlabs/Widget/Newmember.php
+++ b/Zotlabs/Widget/Newmember.php
@@ -9,9 +9,6 @@ class Newmember {
if(! local_channel())
return EMPTY_STR;
- if(get_pconfig(local_channel(), 'system', 'disable_newmemberwidget'))
- return EMPTY_STR;
-
$c = \App::get_channel();
if(! $c)
return EMPTY_STR;
@@ -20,16 +17,9 @@ class Newmember {
if(! $a)
return EMPTY_STR;
- if(datetime_convert('UTC','UTC',$a['account_created']) < datetime_convert('UTC','UTC', 'now - 60 days'))
- return EMPTY_STR;
-
- // This could be a new account that was used to clone a very old channel
-
- $ob = \App::get_observer();
- if($ob && array_key_exists('xchan_name_date',$ob) && $ob['xchan_name_date'] < datetime_convert('UTC','UTC','now - 60 days'))
+ if(! feature_enabled(local_channel(),'start_menu'))
return EMPTY_STR;
-
$options = [
t('Profile Creation'),
[
diff --git a/boot.php b/boot.php
index 6db71b8fb..639d68ad6 100755
--- a/boot.php
+++ b/boot.php
@@ -50,7 +50,7 @@ require_once('include/attach.php');
require_once('include/bbcode.php');
define ( 'PLATFORM_NAME', 'hubzilla' );
-define ( 'STD_VERSION', '3.3.2' );
+define ( 'STD_VERSION', '3.3.3' );
define ( 'ZOT_REVISION', '6.0a' );
@@ -857,7 +857,7 @@ class App {
self::$scheme = 'https';
if(x($_SERVER,'SERVER_NAME')) {
- self::$hostname = $_SERVER['SERVER_NAME'];
+ self::$hostname = punify($_SERVER['SERVER_NAME']);
if(x($_SERVER,'SERVER_PORT') && $_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443)
self::$hostname .= ':' . $_SERVER['SERVER_PORT'];
@@ -954,14 +954,14 @@ class App {
&& is_array(self::$config['system'])
&& array_key_exists('baseurl',self::$config['system'])
&& strlen(self::$config['system']['baseurl'])) {
- $url = self::$config['system']['baseurl'];
+ $url = punify(self::$config['system']['baseurl']);
$url = trim($url,'\\/');
return $url;
}
$scheme = self::$scheme;
- self::$baseurl = $scheme . "://" . self::$hostname . ((isset(self::$path) && strlen(self::$path)) ? '/' . self::$path : '' );
+ self::$baseurl = $scheme . "://" . punify(self::$hostname) . ((isset(self::$path) && strlen(self::$path)) ? '/' . self::$path : '' );
return self::$baseurl;
}
@@ -972,7 +972,7 @@ class App {
&& is_array(self::$config['system'])
&& array_key_exists('baseurl',self::$config['system'])
&& strlen(self::$config['system']['baseurl'])) {
- $url = self::$config['system']['baseurl'];
+ $url = punify(self::$config['system']['baseurl']);
$url = trim($url,'\\/');
}
@@ -983,7 +983,7 @@ class App {
if($parsed !== false) {
self::$scheme = $parsed['scheme'];
- self::$hostname = $parsed['host'];
+ self::$hostname = punify($parsed['host']);
if(x($parsed,'port'))
self::$hostname .= ':' . $parsed['port'];
if(x($parsed,'path'))
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 .= ' ';
diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js
index 2d017db18..f7570523e 100644
--- a/view/js/autocomplete.js
+++ b/view/js/autocomplete.js
@@ -212,6 +212,7 @@ function string2bb(element) {
index: 3,
search: function(term, callback) { $.getJSON('/hashtags/' + '$f=&t=' + term).done(function(data) { callback($.map(data, function(entry) { return entry.text.indexOf(term) === 0 ? entry : null; })); }); },
replace: function(item) { return "$1$2" + item.text + ' '; },
+ context: function(text) { return text.toLowerCase(); },
template: tag_format
};
diff --git a/view/pdl/mod_display.pdl b/view/pdl/mod_display.pdl
index 95f069031..a5461df50 100644
--- a/view/pdl/mod_display.pdl
+++ b/view/pdl/mod_display.pdl
@@ -1,3 +1,6 @@
+[region=aside]
+[widget=vcard][/widget]
+[/region]
[region=right_aside]
[widget=notifications][/widget]
[widget=newmember][/widget]