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] 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 22b34fa62..062f90795 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 5b046228f..020214457 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 1e49311d3..ddd5d03d6 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 727ecb3cc..7bf857e0e 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 a869269d5..cd45cc507 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 eb4ae4577..829bfc70a 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 ea14aa6ff..511cd0444 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 9574ea02b..9db3eabf0 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 b5ae5c2d0..c021f977a 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}}