From 40bba93a310fab27fb14a9b6a55bcaab1530eba2 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 8 Jun 2016 19:34:11 -0700 Subject: [PATCH 1/5] potential fix to hubzilla-addons issue 16 --- include/api.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/api.php b/include/api.php index f0d886d9b..be525f7e9 100644 --- a/include/api.php +++ b/include/api.php @@ -1904,10 +1904,15 @@ require_once('include/api_auth.php'); $ret = array(); + $x = array('items' => $r,'api_user' => api_user(),'user_info' => $user_info); + call_hooks('api_format_items',$x); + $r = $x['items']; + if(! $r) return $ret; foreach($r as $item) { + localize_item($item); $status_user = (($item['author_xchan']==$user_info['guid'])?$user_info: api_item_get_user($a,$item)); From 2ad5010dc3f2f8d077a3228915d28a3e256f6e13 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 8 Jun 2016 20:00:36 -0700 Subject: [PATCH 2/5] issue #59 --- boot.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/boot.php b/boot.php index 76312ed4e..a31d98dbb 100755 --- a/boot.php +++ b/boot.php @@ -1465,6 +1465,12 @@ function check_config(&$a) { @unlink($lockfile); //send the administrator an e-mail file_put_contents($lockfile, $x); + + $r = q("select account_language from account where account_email = '%s' limit 1", + dbesc(App::$config['system']['admin_email']) + ); + push_lang(($r) ? $r[0]['account_language'] : 'en'); + $email_tpl = get_intltext_template("update_fail_eml.tpl"); $email_msg = replace_macros($email_tpl, array( @@ -1482,6 +1488,7 @@ function check_config(&$a) { . 'Content-transfer-encoding: 8bit' ); //try the logger logger('CRITICAL: Update Failed: ' . $x); + pop_lang(); } else set_config('database','update_r' . $x, 'success'); From a10f5e9e06a03789af8f08481409f0ac95059fed Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 9 Jun 2016 16:11:58 -0700 Subject: [PATCH 3/5] allow an exclusion for transmitting hidden file activities. There may be a better way to do this, but it was pointed out recently that transmitting some hidden activities might cause a problem. I cannot locate the conversation at the moment to summarise the exact issue. --- Zotlabs/Daemon/Notifier.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php index 590be31ee..ebc9d83a5 100644 --- a/Zotlabs/Daemon/Notifier.php +++ b/Zotlabs/Daemon/Notifier.php @@ -278,7 +278,11 @@ class Notifier { logger('notifier: target item not forwardable: type ' . $target_item['item_type'], LOGGER_DEBUG); return; } - if(intval($target_item['item_unpublished']) || intval($target_item['item_delayed']) || intval($target_item['item_hidden'])) { + + // Check for non published items, but allow an exclusion for transmitting hidden file activities + + if(intval($target_item['item_unpublished']) || intval($target_item['item_delayed']) || + ( intval($target_item['item_hidden']) && ($target_item['obj_type'] !== ACTIVITY_OBJ_FILE))) { logger('notifier: target item not published, so not forwardable', LOGGER_DEBUG); return; } From 0dcea87b9944c106bce3e9604c8facf58fa9225f Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 9 Jun 2016 16:20:16 -0700 Subject: [PATCH 4/5] namespace issue with openid reverse auth --- Zotlabs/Module/Rmagic.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Zotlabs/Module/Rmagic.php b/Zotlabs/Module/Rmagic.php index bcdbf6c90..26b0c46a6 100644 --- a/Zotlabs/Module/Rmagic.php +++ b/Zotlabs/Module/Rmagic.php @@ -24,7 +24,7 @@ class Rmagic extends \Zotlabs\Web\Controller { } } - function post() { + function post() { $address = trim($_REQUEST['address']); @@ -34,13 +34,13 @@ class Rmagic extends \Zotlabs\Web\Controller { try { require_once('library/openid/openid.php'); - $openid = new LightOpenID(z_root()); + $openid = new \LightOpenID(z_root()); $openid->identity = $address; $openid->returnUrl = z_root() . '/openid'; $openid->required = array('namePerson/friendly', 'namePerson'); $openid->optional = array('namePerson/first','media/image/aspect11','media/image/default'); goaway($openid->authUrl()); - } catch (Exception $e) { + } catch (\Exception $e) { notice( t('We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID.').'

'. t('The error message was:').' '.$e->getMessage()); } @@ -82,7 +82,7 @@ class Rmagic extends \Zotlabs\Web\Controller { } - function get() { + function get() { $o = replace_macros(get_markup_template('rmagic.tpl'),array( '$title' => t('Remote Authentication'), From ee5372784e129ed7a162c7433f56fa3a1e877a67 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 9 Jun 2016 16:45:53 -0700 Subject: [PATCH 5/5] remove the automatic ajax page load on pgdn key; it can load content much faster than you can page and potentially lead to memory exhaustion. --- view/js/main.js | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/view/js/main.js b/view/js/main.js index 15a6b4b8d..f279417d9 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -321,22 +321,6 @@ $(function() { return false; } } - if(event.keyCode == '34') { - if((pageHasMoreContent) && (! loadingPage)) { - $('#more').hide(); - $('#no-more').hide(); - - next_page++; - scroll_next = true; - loadingPage = true; - - if(($('.directory-end').length == 0) && ($('.photos-end').length == 0)) - liveUpdate(); - else - pageUpdate(); - return true; - } - } if(event.keyCode == '19' || (event.ctrlKey && event.which == '32')) { event.preventDefault();