From 682ffa7cf5bc02319750d0f65cd4ce68cf527223 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 23 Mar 2019 19:21:28 +0100 Subject: [PATCH 01/13] db_columns() requires a string, empty var given in process_channel_sync_delivery() --- Zotlabs/Lib/Libsync.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Lib/Libsync.php b/Zotlabs/Lib/Libsync.php index d037a0058..d93270bc5 100644 --- a/Zotlabs/Lib/Libsync.php +++ b/Zotlabs/Lib/Libsync.php @@ -336,7 +336,7 @@ class Libsync { $disallowed = array('abook_id','abook_account','abook_channel','abook_rating','abook_rating_text','abook_not_here'); - $fields = db_columns($abook); + $fields = db_columns('abook'); foreach($arr['abook'] as $abook) { From 3a07a194abb3dfab842e08b242c9a566c97b6e35 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 23 Mar 2019 19:42:22 +0100 Subject: [PATCH 02/13] Webfinger::zot_url() requires a string (webfinger address), empty var given in update_directory_entry() --- Zotlabs/Lib/Libzotdir.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Lib/Libzotdir.php b/Zotlabs/Lib/Libzotdir.php index 91d089c86..4e084554d 100644 --- a/Zotlabs/Lib/Libzotdir.php +++ b/Zotlabs/Lib/Libzotdir.php @@ -307,7 +307,7 @@ class Libzotdir { if ($ud['ud_addr'] && (! ($ud['ud_flags'] & UPDATE_FLAGS_DELETED))) { $success = false; - $href = \Zotlabs\Lib\Webfinger::zot_url(punify($url)); + $href = \Zotlabs\Lib\Webfinger::zot_url($ud['ud_addr']); if($href) { $zf = \Zotlabs\Lib\Zotfinger::exec($href); } From a0af092ecb5ce1018a3d6e53f8636aed6bb2307c Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 23 Mar 2019 20:01:20 +0100 Subject: [PATCH 03/13] fix wrong variable in unused function --- Zotlabs/Lib/ZotURL.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Lib/ZotURL.php b/Zotlabs/Lib/ZotURL.php index d1c705fcb..bc14c516a 100644 --- a/Zotlabs/Lib/ZotURL.php +++ b/Zotlabs/Lib/ZotURL.php @@ -66,7 +66,7 @@ class ZotURL { } - static public function is_zoturl($s) { + static public function is_zoturl($url) { if(strpos($url,'x-zot:') === 0) { return true; From 6f5e6bd0f1de5c365498c68e052fec6e3519f0c9 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 23 Mar 2019 20:17:35 +0100 Subject: [PATCH 04/13] fix typo --- Zotlabs/Module/Acl.php | 2 +- Zotlabs/{Lib => Module/Admin}/Enotify.php | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename Zotlabs/{Lib => Module/Admin}/Enotify.php (100%) diff --git a/Zotlabs/Module/Acl.php b/Zotlabs/Module/Acl.php index 738e8fbe2..82c156a9c 100644 --- a/Zotlabs/Module/Acl.php +++ b/Zotlabs/Module/Acl.php @@ -166,7 +166,7 @@ class Acl extends \Zotlabs\Web\Controller { if($extra_channels) { foreach($extra_channels as $channel) { if(perm_is_allowed(intval($channel), get_observer_hash(),'view_contacts')) { - if($extra_channel_sql) + if($extra_channels_sql) $extra_channels_sql .= ','; $extra_channels_sql .= intval($channel); } diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Module/Admin/Enotify.php similarity index 100% rename from Zotlabs/Lib/Enotify.php rename to Zotlabs/Module/Admin/Enotify.php From 0f5625d7219c1065b99fdcbbbd01b4ba347e4eec Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 23 Mar 2019 20:22:11 +0100 Subject: [PATCH 05/13] revert accidental moving of Enotify.php --- Zotlabs/{Module/Admin => Lib}/Enotify.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Zotlabs/{Module/Admin => Lib}/Enotify.php (100%) diff --git a/Zotlabs/Module/Admin/Enotify.php b/Zotlabs/Lib/Enotify.php similarity index 100% rename from Zotlabs/Module/Admin/Enotify.php rename to Zotlabs/Lib/Enotify.php From c676689df039ac62ed7eda3daba7efda1929b312 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 23 Mar 2019 20:32:15 +0100 Subject: [PATCH 06/13] fix 48 hours timeframe check and remove unused var in mod changeaddr --- Zotlabs/Module/Changeaddr.php | 4 ++-- Zotlabs/Module/{Admin => }/Features.php | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename Zotlabs/Module/{Admin => }/Features.php (100%) diff --git a/Zotlabs/Module/Changeaddr.php b/Zotlabs/Module/Changeaddr.php index 5cd236394..ed139c9f9 100644 --- a/Zotlabs/Module/Changeaddr.php +++ b/Zotlabs/Module/Changeaddr.php @@ -31,7 +31,7 @@ class Changeaddr extends \Zotlabs\Web\Controller { if($account['account_password_changed'] > NULL_DATE) { $d1 = datetime_convert('UTC','UTC','now - 48 hours'); - if($account['account_password_changed'] > d1) { + if($account['account_password_changed'] > $d1) { notice( t('Channel name changes are not allowed within 48 hours of changing the account password.') . EOL); return; } @@ -49,7 +49,7 @@ class Changeaddr extends \Zotlabs\Web\Controller { if(check_webbie(array($new_address)) !== $new_address) { notice( t('Nickname has unsupported characters or is already being used on this site.') . EOL); - return $ret; + return; } channel_change_address($channel,$new_address); diff --git a/Zotlabs/Module/Admin/Features.php b/Zotlabs/Module/Features.php similarity index 100% rename from Zotlabs/Module/Admin/Features.php rename to Zotlabs/Module/Features.php From c11fbe0868016a070468599145728dd31cf66158 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 23 Mar 2019 20:33:43 +0100 Subject: [PATCH 07/13] revert accidental moving of Features.php --- Zotlabs/Module/{Settings => Admin}/Features.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Zotlabs/Module/{Settings => Admin}/Features.php (100%) diff --git a/Zotlabs/Module/Settings/Features.php b/Zotlabs/Module/Admin/Features.php similarity index 100% rename from Zotlabs/Module/Settings/Features.php rename to Zotlabs/Module/Admin/Features.php From 4d4425a5bf7a2227c3e70f7ab51375390aa69db2 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 23 Mar 2019 20:57:22 +0100 Subject: [PATCH 08/13] fix variables for xporof_locale and xprof_postcode --- Zotlabs/Module/Dirsearch.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Zotlabs/Module/Dirsearch.php b/Zotlabs/Module/Dirsearch.php index 81942860f..26cb82044 100644 --- a/Zotlabs/Module/Dirsearch.php +++ b/Zotlabs/Module/Dirsearch.php @@ -116,12 +116,12 @@ class Dirsearch extends \Zotlabs\Web\Controller { $sql_extra .= $this->dir_query_build($joiner,'xchan_name',$name); if($address) $sql_extra .= $this->dir_query_build($joiner,'xchan_addr',$address); - if($city) - $sql_extra .= $this->dir_query_build($joiner,'xprof_locale',$city); + if($locale) + $sql_extra .= $this->dir_query_build($joiner,'xprof_locale',$locale); if($region) $sql_extra .= $this->dir_query_build($joiner,'xprof_region',$region); - if($post) - $sql_extra .= $this->dir_query_build($joiner,'xprof_postcode',$post); + if($postcode) + $sql_extra .= $this->dir_query_build($joiner,'xprof_postcode',$postcode); if($country) $sql_extra .= $this->dir_query_build($joiner,'xprof_country',$country); if($gender) From d2725c3f49c509f031607a15889850b8defe7bad Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 23 Mar 2019 21:50:50 +0100 Subject: [PATCH 09/13] aparently we do not use underscores anymore. this fixes spaming of dreports with recipient not found entries for our own xchan --- Zotlabs/Lib/DReport.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Lib/DReport.php b/Zotlabs/Lib/DReport.php index 18087e29f..7515d3292 100644 --- a/Zotlabs/Lib/DReport.php +++ b/Zotlabs/Lib/DReport.php @@ -118,7 +118,7 @@ class DReport { // So if a remote site says they can't find us, that's no big surprise // and just creates a lot of extra report noise - if(($dr['location'] !== z_root()) && ($dr['sender'] === $rxchan) && ($dr['status'] === 'recipient_not_found')) + if(($dr['location'] !== z_root()) && ($dr['sender'] === $rxchan) && ($dr['status'] === 'recipient not found')) return false; // If you have a private post with a recipient list, every single site is going to report From 393494a7282a0a69d4d3367ac9f00185e9de8140 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 23 Mar 2019 22:01:46 +0100 Subject: [PATCH 10/13] fix revert accidental moving of Features.php --- Zotlabs/Module/Admin/Features.php | 88 +++++++++++++++++----------- Zotlabs/Module/Features.php | 74 ----------------------- Zotlabs/Module/Settings/Features.php | 52 ++++++++++++++++ 3 files changed, 107 insertions(+), 107 deletions(-) delete mode 100644 Zotlabs/Module/Features.php create mode 100644 Zotlabs/Module/Settings/Features.php diff --git a/Zotlabs/Module/Admin/Features.php b/Zotlabs/Module/Admin/Features.php index 6a3ab104b..504caae79 100644 --- a/Zotlabs/Module/Admin/Features.php +++ b/Zotlabs/Module/Admin/Features.php @@ -1,52 +1,74 @@ $fdata) { foreach(array_slice($fdata,1) as $f) { - $k = $f[0]; - if(array_key_exists("feature_$k",$_POST)) - set_pconfig(local_channel(),'feature',$k, (string) $_POST["feature_$k"]); + $feature = $f[0]; + + if(array_key_exists('feature_' . $feature,$_POST)) + $val = intval($_POST['feature_' . $feature]); else - set_pconfig(local_channel(),'feature', $k, ''); + $val = 0; + set_config('feature',$feature,$val); + + if(array_key_exists('featurelock_' . $feature,$_POST)) + set_config('feature_lock',$feature,$val); + else + del_config('feature_lock',$feature); } } - build_sync_packet(); - return; + + goaway(z_root() . '/admin/features' ); + } - + function get() { - $arr = []; - - $features = get_features(false); - - foreach($features as $fname => $fdata) { - $arr[$fname] = array(); - $arr[$fname][0] = $fdata[0]; - foreach(array_slice($fdata,1) as $f) { - $arr[$fname][1][] = array('feature_' . $f[0],$f[1],((intval(feature_enabled(local_channel(),$f[0]))) ? "1" : ''),$f[2],array(t('Off'),t('On'))); - } - } - - $tpl = get_markup_template("settings_features.tpl"); - $o .= replace_macros($tpl, array( - '$form_security_token' => get_form_security_token("settings_features"), - '$title' => t('Additional Features'), - '$features' => $arr, - '$baseurl' => z_root(), - '$submit' => t('Submit'), - )); + if((argc() > 1) && (argv(1) === 'features')) { + $arr = array(); + $features = get_features(false); - return $o; + foreach($features as $fname => $fdata) { + $arr[$fname] = array(); + $arr[$fname][0] = $fdata[0]; + foreach(array_slice($fdata,1) as $f) { + + $set = get_config('feature',$f[0]); + if($set === false) + $set = $f[3]; + $arr[$fname][1][] = array( + array('feature_' .$f[0],$f[1],$set,$f[2],array(t('Off'),t('On'))), + array('featurelock_' .$f[0],sprintf( t('Lock feature %s'),$f[1]),(($f[4] !== false) ? 1 : 0),'',array(t('Off'),t('On'))) + ); + } + } + + $tpl = get_markup_template("admin_settings_features.tpl"); + $o .= replace_macros($tpl, array( + '$form_security_token' => get_form_security_token("admin_manage_features"), + '$title' => t('Manage Additional Features'), + '$features' => $arr, + '$submit' => t('Submit'), + )); + + return $o; + } } + -} +} \ No newline at end of file diff --git a/Zotlabs/Module/Features.php b/Zotlabs/Module/Features.php deleted file mode 100644 index 504caae79..000000000 --- a/Zotlabs/Module/Features.php +++ /dev/null @@ -1,74 +0,0 @@ - $fdata) { - foreach(array_slice($fdata,1) as $f) { - $feature = $f[0]; - - if(array_key_exists('feature_' . $feature,$_POST)) - $val = intval($_POST['feature_' . $feature]); - else - $val = 0; - set_config('feature',$feature,$val); - - if(array_key_exists('featurelock_' . $feature,$_POST)) - set_config('feature_lock',$feature,$val); - else - del_config('feature_lock',$feature); - } - } - - goaway(z_root() . '/admin/features' ); - - } - - function get() { - - if((argc() > 1) && (argv(1) === 'features')) { - $arr = array(); - $features = get_features(false); - - foreach($features as $fname => $fdata) { - $arr[$fname] = array(); - $arr[$fname][0] = $fdata[0]; - foreach(array_slice($fdata,1) as $f) { - - $set = get_config('feature',$f[0]); - if($set === false) - $set = $f[3]; - $arr[$fname][1][] = array( - array('feature_' .$f[0],$f[1],$set,$f[2],array(t('Off'),t('On'))), - array('featurelock_' .$f[0],sprintf( t('Lock feature %s'),$f[1]),(($f[4] !== false) ? 1 : 0),'',array(t('Off'),t('On'))) - ); - } - } - - $tpl = get_markup_template("admin_settings_features.tpl"); - $o .= replace_macros($tpl, array( - '$form_security_token' => get_form_security_token("admin_manage_features"), - '$title' => t('Manage Additional Features'), - '$features' => $arr, - '$submit' => t('Submit'), - )); - - return $o; - } - } - - -} \ No newline at end of file diff --git a/Zotlabs/Module/Settings/Features.php b/Zotlabs/Module/Settings/Features.php new file mode 100644 index 000000000..6a3ab104b --- /dev/null +++ b/Zotlabs/Module/Settings/Features.php @@ -0,0 +1,52 @@ + $fdata) { + foreach(array_slice($fdata,1) as $f) { + $k = $f[0]; + if(array_key_exists("feature_$k",$_POST)) + set_pconfig(local_channel(),'feature',$k, (string) $_POST["feature_$k"]); + else + set_pconfig(local_channel(),'feature', $k, ''); + } + } + build_sync_packet(); + return; + } + + function get() { + + $arr = []; + + $features = get_features(false); + + foreach($features as $fname => $fdata) { + $arr[$fname] = array(); + $arr[$fname][0] = $fdata[0]; + foreach(array_slice($fdata,1) as $f) { + $arr[$fname][1][] = array('feature_' . $f[0],$f[1],((intval(feature_enabled(local_channel(),$f[0]))) ? "1" : ''),$f[2],array(t('Off'),t('On'))); + } + } + + $tpl = get_markup_template("settings_features.tpl"); + $o .= replace_macros($tpl, array( + '$form_security_token' => get_form_security_token("settings_features"), + '$title' => t('Additional Features'), + '$features' => $arr, + '$baseurl' => z_root(), + '$submit' => t('Submit'), + )); + + return $o; + } + +} From 3094c2ce17480f7aca76fe9c2ff1eacd2d20d934 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 23 Mar 2019 22:48:52 +0100 Subject: [PATCH 11/13] fix subthread on sys channel items --- Zotlabs/Module/Subthread.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Module/Subthread.php b/Zotlabs/Module/Subthread.php index 54343fdfa..30e57197d 100644 --- a/Zotlabs/Module/Subthread.php +++ b/Zotlabs/Module/Subthread.php @@ -33,7 +33,7 @@ class Subthread extends \Zotlabs\Web\Controller { if(! $i) { $i = q("select * from item where id = %d and uid = %d", - intval($postid), + intval($item_id), intval($sys['channel_id']) ); From 3c3a4526bf7244626898e13bd2db1d8255885ed1 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 23 Mar 2019 22:49:27 +0100 Subject: [PATCH 12/13] fix typo --- Zotlabs/Module/Tagger.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Module/Tagger.php b/Zotlabs/Module/Tagger.php index 24adf1bde..e6e80dce3 100644 --- a/Zotlabs/Module/Tagger.php +++ b/Zotlabs/Module/Tagger.php @@ -69,7 +69,7 @@ class Tagger extends \Zotlabs\Web\Controller { $post_type = t('photo'); break; case 'event': - $targgettype = ACTIVITY_OBJ_EVENT; + $targettype = ACTIVITY_OBJ_EVENT; $post_type = t('event'); break; default: From 9d186e9ba3bdb206f4f85eed8662c1c87054fbdf Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 23 Mar 2019 22:53:29 +0100 Subject: [PATCH 13/13] add punify() again --- Zotlabs/Lib/Libzotdir.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Lib/Libzotdir.php b/Zotlabs/Lib/Libzotdir.php index 4e084554d..1cb52275c 100644 --- a/Zotlabs/Lib/Libzotdir.php +++ b/Zotlabs/Lib/Libzotdir.php @@ -307,7 +307,7 @@ class Libzotdir { if ($ud['ud_addr'] && (! ($ud['ud_flags'] & UPDATE_FLAGS_DELETED))) { $success = false; - $href = \Zotlabs\Lib\Webfinger::zot_url($ud['ud_addr']); + $href = \Zotlabs\Lib\Webfinger::zot_url(punify($ud['ud_addr'])); if($href) { $zf = \Zotlabs\Lib\Zotfinger::exec($href); } @@ -651,4 +651,4 @@ class Libzotdir { -} \ No newline at end of file +}