From 9cc0d5479bce29ec7a9a41c8e6643ec813175c5f Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Thu, 23 Mar 2017 22:49:05 +0100 Subject: [PATCH 01/21] old behaviour restored Signed-off-by: Roland Haeder --- src/Protocol/DFRN.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index a9e836499f..09fb0dacdc 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -2357,7 +2357,11 @@ class DFRN ); if (!DBM::is_result($r)) { + /* + * @TODO maybe one day: logger("Query failed to execute, no result returned in " . __FUNCTION__); + killme(); + */ return false; } From f2f12d6f50893d0a35d0db4ca3adbf8a3f8caa9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Thu, 20 Jul 2017 20:04:32 +0200 Subject: [PATCH 02/21] Minor improvements: - added spaces and curly braces - added more TODOs as there really more to be done - removed redundant braces from "return" keyword (no function) - merged 2 nested if() into one single MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- include/text.php | 1 + 1 file changed, 1 insertion(+) diff --git a/include/text.php b/include/text.php index 10f6264586..f1bc512326 100644 --- a/include/text.php +++ b/include/text.php @@ -1970,6 +1970,7 @@ function is_a_date_arg($s) { */ function deindent($text, $chr = "[\t ]", $count = NULL) { $lines = explode("\n", $text); + if (is_null($count)) { $m = []; $k = 0; From 63f55987668b429c5b72e69dbde0d1c2ef3acc7d Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Thu, 23 Mar 2017 22:26:07 +0100 Subject: [PATCH 03/21] better comment added by @Hypolite Signed-off-by: Roland Haeder --- src/Protocol/DFRN.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 09fb0dacdc..3b94842e26 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -1973,11 +1973,9 @@ class DFRN */ if (!DBM::is_result($r)) { // database record did not get created. Quietly give up. - killme(); + return false; } - $fid = $r[0]["id"]; - $hash = random_string(); $r = q( From a95db714ca758bbc45373e855c470f5a182df149 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Thu, 23 Mar 2017 22:33:12 +0100 Subject: [PATCH 04/21] added curely branches + reverted back to old behaviour (may come back one day) Signed-off-by: Roland Haeder --- src/Protocol/DFRN.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 3b94842e26..1b760b0644 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -2056,7 +2056,11 @@ class DFRN ); if (!DBM::is_result($r)) { + /* + * @TODO maybe one day: logger("Query failed to execute, no result returned in " . __FUNCTION__); + killme(); + */ return false; } From 22bbfdadd058d2bddc780f220d77918cf872cb64 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Thu, 23 Mar 2017 23:05:53 +0100 Subject: [PATCH 05/21] added more curly braces + spaces for #3254 Signed-off-by: Roland Haeder --- mod/profiles.php | 1 + 1 file changed, 1 insertion(+) diff --git a/mod/profiles.php b/mod/profiles.php index 9c925924f7..3ceb8c6645 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -479,6 +479,7 @@ function profiles_post(App $a) { intval(local_user()) ); + /// @TODO decide to use dbm::is_result() here and check $r if ($r) { info(L10n::t('Profile updated.') . EOL); } From f0b05838cb1ee23dde1c1b1a875c247530f12d38 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Thu, 23 Mar 2017 23:37:58 +0100 Subject: [PATCH 06/21] fixed comment and explained one Signed-off-by: Roland Haeder --- src/Protocol/DFRN.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 1b760b0644..6a64a82958 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -1973,9 +1973,11 @@ class DFRN */ if (!DBM::is_result($r)) { // database record did not get created. Quietly give up. - return false; + killme(); } + $fid = $r[0]["id"]; + $hash = random_string(); $r = q( From f89b99965974854ef27b5c54cdda8935cf8d976b Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Sat, 25 Mar 2017 13:46:28 +0100 Subject: [PATCH 07/21] was a bit confusing for me or I was not sleeping to much ... Signed-off-by: Roland Haeder --- src/Protocol/DFRN.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 6a64a82958..a9e836499f 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -2058,11 +2058,7 @@ class DFRN ); if (!DBM::is_result($r)) { - /* - * @TODO maybe one day: logger("Query failed to execute, no result returned in " . __FUNCTION__); - killme(); - */ return false; } @@ -2361,11 +2357,7 @@ class DFRN ); if (!DBM::is_result($r)) { - /* - * @TODO maybe one day: logger("Query failed to execute, no result returned in " . __FUNCTION__); - killme(); - */ return false; } From fe77e1b5384fca3efd11c9280a6e2c1bc5a2d481 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Wed, 25 Jan 2017 15:59:27 +0100 Subject: [PATCH 08/21] added more curly braces + a bit more usage of dbm::is_result() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- src/Protocol/DFRN.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index a9e836499f..31d94e77e2 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -96,6 +96,7 @@ class DFRN * @param boolean $onlyheader Output only the header without content? (Default is "no") * * @return string DFRN feed entries + * @todo Find proper type-hints */ public static function feed($dfrn_id, $owner_nick, $last_update, $direction = 0, $onlyheader = false) { From 852ef4021b30c56185818971e17a50eec0a7a5a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Thu, 26 Jan 2017 16:07:30 +0100 Subject: [PATCH 09/21] more spaces + some curly spaces added MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- include/text.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/text.php b/include/text.php index f1bc512326..9d8ba26043 100644 --- a/include/text.php +++ b/include/text.php @@ -1883,8 +1883,15 @@ function file_tag_save_file($uid, $item, $file) return true; } +<<<<<<< HEAD function file_tag_unsave_file($uid, $item, $file, $cat = false) { +======= +function file_tag_unsave_file($uid, $item, $file, $cat = false) { + require_once "include/files.php"; + + $result = false; +>>>>>>> more spaces + some curly spaces added if (! intval($uid)) { return false; } From ad9bd7bb72cf7fa22d4d87b690e379056e42df5b Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Thu, 23 Mar 2017 22:26:07 +0100 Subject: [PATCH 10/21] better comment added by @Hypolite Signed-off-by: Roland Haeder --- src/Protocol/DFRN.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 31d94e77e2..d1870254b7 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -1974,11 +1974,9 @@ class DFRN */ if (!DBM::is_result($r)) { // database record did not get created. Quietly give up. - killme(); + return false; } - $fid = $r[0]["id"]; - $hash = random_string(); $r = q( From 0e5daa86df145481e8464b5b1d6342d623d8676b Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Thu, 23 Mar 2017 22:33:12 +0100 Subject: [PATCH 11/21] added curely branches + reverted back to old behaviour (may come back one day) Signed-off-by: Roland Haeder --- src/Protocol/DFRN.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index d1870254b7..20c59fc2f8 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -2057,7 +2057,11 @@ class DFRN ); if (!DBM::is_result($r)) { + /* + * @TODO maybe one day: logger("Query failed to execute, no result returned in " . __FUNCTION__); + killme(); + */ return false; } From a5dba628c44fe64d2f4138dce7ef1cec13148770 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Thu, 23 Mar 2017 22:49:05 +0100 Subject: [PATCH 12/21] old behaviour restored Signed-off-by: Roland Haeder --- src/Protocol/DFRN.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 20c59fc2f8..897f6a8cc5 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -2360,7 +2360,11 @@ class DFRN ); if (!DBM::is_result($r)) { + /* + * @TODO maybe one day: logger("Query failed to execute, no result returned in " . __FUNCTION__); + killme(); + */ return false; } From 1567eb0791d61b5718d30ecc84e249347d71b1dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Tue, 15 May 2018 23:25:30 +0200 Subject: [PATCH 13/21] fixed another left-over ... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- include/text.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/include/text.php b/include/text.php index 9d8ba26043..f1bc512326 100644 --- a/include/text.php +++ b/include/text.php @@ -1883,15 +1883,8 @@ function file_tag_save_file($uid, $item, $file) return true; } -<<<<<<< HEAD function file_tag_unsave_file($uid, $item, $file, $cat = false) { -======= -function file_tag_unsave_file($uid, $item, $file, $cat = false) { - require_once "include/files.php"; - - $result = false; ->>>>>>> more spaces + some curly spaces added if (! intval($uid)) { return false; } From 4ca26fd3bc60817752e0c45679283a1217ac1e68 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Thu, 23 Mar 2017 23:37:58 +0100 Subject: [PATCH 14/21] fixed comment and explained one Signed-off-by: Roland Haeder --- src/Protocol/DFRN.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 897f6a8cc5..93cc8f2ab1 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -1974,9 +1974,11 @@ class DFRN */ if (!DBM::is_result($r)) { // database record did not get created. Quietly give up. - return false; + killme(); } + $fid = $r[0]["id"]; + $hash = random_string(); $r = q( From 506657ec424d78e368da99e6ba31d41c3c5c8297 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Sat, 25 Mar 2017 13:01:41 +0100 Subject: [PATCH 15/21] removed TODO, one day this all needs refacturizing ... Signed-off-by: Roland Haeder --- mod/profiles.php | 1 - 1 file changed, 1 deletion(-) diff --git a/mod/profiles.php b/mod/profiles.php index 3ceb8c6645..9c925924f7 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -479,7 +479,6 @@ function profiles_post(App $a) { intval(local_user()) ); - /// @TODO decide to use dbm::is_result() here and check $r if ($r) { info(L10n::t('Profile updated.') . EOL); } From 2d744fa18978fa83135197c4b400099c09754b2a Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Sat, 25 Mar 2017 13:37:15 +0100 Subject: [PATCH 16/21] PHP5 does not support native type-hints, except `array` + used dbm::is_result() Signed-off-by: Roland Haeder --- src/Protocol/DFRN.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 93cc8f2ab1..6a64a82958 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -96,7 +96,6 @@ class DFRN * @param boolean $onlyheader Output only the header without content? (Default is "no") * * @return string DFRN feed entries - * @todo Find proper type-hints */ public static function feed($dfrn_id, $owner_nick, $last_update, $direction = 0, $onlyheader = false) { From 593d1feca621cf48e8c4afe140c6f8ed476e5c7a Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Sat, 25 Mar 2017 13:46:28 +0100 Subject: [PATCH 17/21] was a bit confusing for me or I was not sleeping to much ... Signed-off-by: Roland Haeder --- src/Protocol/DFRN.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 6a64a82958..a9e836499f 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -2058,11 +2058,7 @@ class DFRN ); if (!DBM::is_result($r)) { - /* - * @TODO maybe one day: logger("Query failed to execute, no result returned in " . __FUNCTION__); - killme(); - */ return false; } @@ -2361,11 +2357,7 @@ class DFRN ); if (!DBM::is_result($r)) { - /* - * @TODO maybe one day: logger("Query failed to execute, no result returned in " . __FUNCTION__); - killme(); - */ return false; } From 7c048b50778ac0ad8a8be7b8219847732067f205 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Sat, 25 Mar 2017 15:06:54 +0100 Subject: [PATCH 18/21] Opps, cutted this out by accident ... Signed-off-by: Roland Haeder --- mod/photos.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mod/photos.php b/mod/photos.php index e823da59ff..92fdfb0484 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -1232,6 +1232,8 @@ function photos_content(App $a) if (!Config::get('system', 'no_count', false)) { $order_field = defaults($_GET, 'order', ''); if ($order_field === 'posted') { + if (!Config::get('system', 'no_count', false)) { + if ($_GET['order'] === 'posted') { $order = 'ASC'; } else { $order = 'DESC'; From 6cb26f884e4622ead2469663b8afd055971379b9 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Sun, 2 Apr 2017 21:29:06 +0200 Subject: [PATCH 19/21] Fixes for composer: - ./vendor/ is being prepared by executing `utils/composer.phar install`, no need to have it around - converted .gitignore to LF line-ending (more common over the whole project) - no need to have them around ... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- mod/photos.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/mod/photos.php b/mod/photos.php index 92fdfb0484..727ecb3cc1 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -1229,9 +1229,6 @@ function photos_content(App $a) * The query leads to a really intense used index. * By now we hide it if someone wants to. */ - if (!Config::get('system', 'no_count', false)) { - $order_field = defaults($_GET, 'order', ''); - if ($order_field === 'posted') { if (!Config::get('system', 'no_count', false)) { if ($_GET['order'] === 'posted') { $order = 'ASC'; From f806fa91b1cc0726395986a6a696a9ab68a39433 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 2 May 2018 19:26:15 +0000 Subject: [PATCH 20/21] Replace old database queries with the new ones --- mod/message.php | 2 +- mod/settings.php | 2 +- src/Protocol/DFRN.php | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/mod/message.php b/mod/message.php index 987babf744..1e49311d3f 100644 --- a/mod/message.php +++ b/mod/message.php @@ -148,7 +148,7 @@ function message_content(App $a) $cmd = $a->argv[1]; if ($cmd === 'drop') { - if (dba::delete('mail', ['id' => $a->argv[2], 'uid' => local_user()])) { + if (dba::delete('mail', ['id' => $a->argv[2]])) { info(L10n::t('Message deleted.') . EOL); } //goaway(System::baseUrl(true) . '/message' ); diff --git a/mod/settings.php b/mod/settings.php index cd45cc5070..a869269d5c 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -149,7 +149,7 @@ function settings_post(App $a) check_form_security_token_redirectOnErr('/settings/oauth', 'settings_oauth'); $key = $_POST['remove']; - dba::delete('tokens', ['id' => $key, 'uid' => local_user()]); + dba::delete('tokens', ['id' => $key]); goaway(System::baseUrl(true)."/settings/oauth/"); return; } diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index a9e836499f..ea14aa6ffa 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -2080,7 +2080,6 @@ class DFRN 'confirm' => $relocate["confirm"], 'notify' => $relocate["notify"], 'poll' => $relocate["poll"], 'site-pubkey' => $relocate["sitepubkey"]]; $condition = ["(`id` = ?) OR (`nurl` = ?)", $importer["id"], normalise_link($old["url"])]; - dba::update('contact', $fields, $condition); // @TODO No dba:update here? dba::update('contact', $fields, $condition); From 8ad523fbc8e346cd21f60e69ef27d3ab039abbe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Wed, 20 Jun 2018 22:12:59 +0200 Subject: [PATCH 21/21] Continued a bit: - removed/fixed whitespaces and mixture of spaces/tabs (some) - added new-line character at end of files (POSIX-compilant) - reverted some code which I had messed up (compared to upstream/develop) - removed duplicate dba::update() invocation in src/Protocol/DFRN.php - also removed no longer valid TODO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- doc/Addons.md | 8 ++++---- doc/Tags-and-Mentions.md | 6 +++--- mod/message.php | 4 +++- mod/photos.php | 4 +++- mod/settings.php | 2 +- mods/sample-nginx.config | 5 ++--- src/Protocol/DFRN.php | 1 - view/theme/frio/js/mod_notifications.js | 2 +- view/theme/quattro/templates/nav.tpl | 14 +++++++------- 9 files changed, 24 insertions(+), 22 deletions(-) diff --git a/doc/Addons.md b/doc/Addons.md index 22b34fa62b..062f90795a 100644 --- a/doc/Addons.md +++ b/doc/Addons.md @@ -72,12 +72,12 @@ JavaScript addon hooks --- #### PHP part -Make sure your JavaScript addon file (addon/*addon_name*/*addon_name*.js) is listed in the document response. +Make sure your JavaScript addon file (addon/*addon_name*/*addon_name*.js) is listed in the document response. In your addon install function, add: Addon::registerHook('template_vars', 'addon//.php', '_template_vars'); - + In your addon uninstall function, add: Addon::unregisterHook('template_vars', 'addon//.php', '_template_vars'); @@ -104,7 +104,7 @@ Register your addon hooks in file 'addon/*addon_name*/*addon_name*.js'. No arguments are provided to your JavaScript callback function. Example: function myhook_function() { - + } Modules @@ -668,4 +668,4 @@ Here is a complete list of all hook callbacks with file locations (as of 01-Apr- ### view/js/main.js - callAddonHooks("postprocess_liveupdate"); \ No newline at end of file + callAddonHooks("postprocess_liveupdate"); diff --git a/doc/Tags-and-Mentions.md b/doc/Tags-and-Mentions.md index 5b046228f7..020214457a 100644 --- a/doc/Tags-and-Mentions.md +++ b/doc/Tags-and-Mentions.md @@ -18,7 +18,7 @@ You can tag **persons who are in your social circle** by adding the "@"-sign in * @mike+151 - this form is used by the drop-down tag completion tool. It indicates the contact whose nickname is mike and whose contact identifier number is 151. The drop-down tool may be used to resolve people with duplicate nicknames. You can tag a person on a different network or one that is **not in your social circle** by using the following notation: - + * @mike@macgirvin.com - This is called a "remote mention" and can only be an email-style locator, not a web URL. Unless their system blocks unsolicited "mentions", the person tagged will likely receive a "Mention" post/activity or become a direct participant in the conversation in the case of public posts. @@ -27,7 +27,7 @@ The exception is an ongoing conversation started from a contact of both you and This is a spam prevention measure. Remote mentions are delivered using the OStatus protocol. -This protocol is used by Friendica and GNU Social and several other systems like Mastodon, but is not currently implemented in Diaspora. +This protocol is used by Friendica and GNU Social and several other systems like Mastodon, but is not currently implemented in Diaspora. As the OStatus protocol allows this Friendica user can be @-mentioned by users from platforms using this protocol in conversations if the "Enable OStatus support" is activated on the Friendica node. These @-mentions wont be blocked, even if there is no relationship between the sender and the receiver of the message. @@ -52,5 +52,5 @@ The same rules apply as with names that spaces within tags are represented by th It is therefore not possible to create a tag whose target contains an underscore. Topical tags are also not linked if they are purely numeric, e.g. #1. -If you wish to use a numerica hashtag, please add some descriptive text such as #2012-elections. +If you wish to use a numerica hashtag, please add some descriptive text such as #2012-elections. diff --git a/mod/message.php b/mod/message.php index 1e49311d3f..ddd5d03d66 100644 --- a/mod/message.php +++ b/mod/message.php @@ -141,6 +141,7 @@ function message_content(App $a) '$cancel' => L10n::t('Cancel'), ]); } + // Now check how the user responded to the confirmation query if ($_REQUEST['canceled']) { goaway($_SESSION['return_url']); @@ -148,9 +149,10 @@ function message_content(App $a) $cmd = $a->argv[1]; if ($cmd === 'drop') { - if (dba::delete('mail', ['id' => $a->argv[2]])) { + if (dba::delete('mail', ['id' => $a->argv[2], 'uid' => local_user()])) { info(L10n::t('Message deleted.') . EOL); } + //goaway(System::baseUrl(true) . '/message' ); goaway($_SESSION['return_url']); } else { diff --git a/mod/photos.php b/mod/photos.php index 727ecb3cc1..7bf857e0e4 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -1230,7 +1230,9 @@ function photos_content(App $a) * By now we hide it if someone wants to. */ if (!Config::get('system', 'no_count', false)) { - if ($_GET['order'] === 'posted') { + $order_field = defaults($_GET, 'order', ''); + + if ($order_field === 'posted') { $order = 'ASC'; } else { $order = 'DESC'; diff --git a/mod/settings.php b/mod/settings.php index a869269d5c..cd45cc5070 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -149,7 +149,7 @@ function settings_post(App $a) check_form_security_token_redirectOnErr('/settings/oauth', 'settings_oauth'); $key = $_POST['remove']; - dba::delete('tokens', ['id' => $key]); + dba::delete('tokens', ['id' => $key, 'uid' => local_user()]); goaway(System::baseUrl(true)."/settings/oauth/"); return; } diff --git a/mods/sample-nginx.config b/mods/sample-nginx.config index eb4ae45770..829bfc70af 100644 --- a/mods/sample-nginx.config +++ b/mods/sample-nginx.config @@ -83,10 +83,9 @@ server { # rewrite to front controller as default rule location / { if (!-e $request_filename) { - rewrite ^(.*)$ /index.php?pagename=$1; + rewrite ^(.*)$ /index.php?pagename=$1; } } - # make sure webfinger and other well known services aren't blocked # by denying dot files and rewrite request to the front controller @@ -96,7 +95,7 @@ server { rewrite ^(.*)$ /index.php?pagename=$1; } } - + include mime.types; # block these file types diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index ea14aa6ffa..511cd0444a 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -2081,7 +2081,6 @@ class DFRN 'poll' => $relocate["poll"], 'site-pubkey' => $relocate["sitepubkey"]]; $condition = ["(`id` = ?) OR (`nurl` = ?)", $importer["id"], normalise_link($old["url"])]; - // @TODO No dba:update here? dba::update('contact', $fields, $condition); Contact::updateAvatar($relocate["avatar"], $importer["importer_uid"], $importer["id"], true); diff --git a/view/theme/frio/js/mod_notifications.js b/view/theme/frio/js/mod_notifications.js index 9574ea02b6..9db3eabf07 100644 --- a/view/theme/frio/js/mod_notifications.js +++ b/view/theme/frio/js/mod_notifications.js @@ -7,7 +7,7 @@ var introID = location.pathname.split("/").pop(); $(document).ready(function(){ - // Since only the DIV's inside the notification-list are marked + // Since only the DIV's inside the notification-list are marked // with the class "unseen", we need some js to transfer this class // to the parent li list-elements. if($(".notif-item").hasClass("unseen")) { diff --git a/view/theme/quattro/templates/nav.tpl b/view/theme/quattro/templates/nav.tpl index b5ae5c2d07..c021f977ab 100644 --- a/view/theme/quattro/templates/nav.tpl +++ b/view/theme/quattro/templates/nav.tpl @@ -66,22 +66,22 @@
  • {{$emptynotifications}}
  • - - {{/if}} - + + {{/if}} +
  • {{$nav.tos.1}}
  • {{/if}} + - + {{if $nav.help}}