From a7ce601580b07e9b3e7653cbdb0a9b6bbb5c474e Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 9 Jan 2017 23:14:55 +1100 Subject: [PATCH] Normalize App parameter declaration (mod folder, 3 out of 3) --- mod/profiles.php | 6 +++--- mod/profperm.php | 8 ++++---- mod/pubsub.php | 8 ++++---- mod/pubsubhubbub.php | 2 +- mod/qsearch.php | 2 +- mod/randprof.php | 2 +- mod/receive.php | 2 +- mod/redir.php | 6 +++--- mod/register.php | 4 ++-- mod/regmod.php | 2 +- mod/removeme.php | 4 ++-- mod/repair_ostatus.php | 2 +- mod/rsd_xml.php | 2 +- mod/salmon.php | 4 ++-- mod/search.php | 6 +++--- mod/session.php | 2 +- mod/settings.php | 6 +++--- mod/share.php | 6 +++--- mod/smilies.php | 2 +- mod/starred.php | 2 +- mod/statistics_json.php | 2 +- mod/subthread.php | 4 ++-- mod/suggest.php | 4 ++-- mod/tagger.php | 2 +- mod/tagrm.php | 6 +++--- mod/toggle_mobile.php | 2 +- mod/uexport.php | 6 +++--- mod/uimport.php | 12 ++++++------ mod/update_community.php | 2 +- mod/update_display.php | 2 +- mod/update_network.php | 2 +- mod/update_notes.php | 2 +- mod/update_profile.php | 2 +- mod/videos.php | 6 +++--- mod/viewcontacts.php | 4 ++-- mod/viewsrc.php | 4 ++-- mod/wall_attach.php | 2 +- mod/wall_upload.php | 2 +- mod/wallmessage.php | 8 ++++---- mod/webfinger.php | 2 +- mod/xrd.php | 2 +- 41 files changed, 78 insertions(+), 78 deletions(-) diff --git a/mod/profiles.php b/mod/profiles.php index bf2f20d2a..abc9dda55 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -2,7 +2,7 @@ require_once("include/Contact.php"); require_once('include/Probe.php'); -function profiles_init(App &$a) { +function profiles_init(App $a) { nav_set_selected('profiles'); @@ -160,7 +160,7 @@ function profile_clean_keywords($keywords) { return $keywords; } -function profiles_post(App &$a) { +function profiles_post(App $a) { if (! local_user()) { notice( t('Permission denied.') . EOL); @@ -601,7 +601,7 @@ function profile_activity($changed, $value) { } -function profiles_content(App &$a) { +function profiles_content(App $a) { if (! local_user()) { notice( t('Permission denied.') . EOL); diff --git a/mod/profperm.php b/mod/profperm.php index bbb055b02..a414d8947 100644 --- a/mod/profperm.php +++ b/mod/profperm.php @@ -1,6 +1,6 @@ '; - if($change) + if($change) $o = ''; - + $o .= '
'; $o .= '

' . t('Visible To') . '

'; $o .= '
'; diff --git a/mod/pubsub.php b/mod/pubsub.php index 308e237d5..2ba1958a2 100644 --- a/mod/pubsub.php +++ b/mod/pubsub.php @@ -26,7 +26,7 @@ function hub_post_return() { -function pubsub_init(App &$a) { +function pubsub_init(App $a) { $nick = (($a->argc > 1) ? notags(trim($a->argv[1])) : ''); $contact_id = (($a->argc > 2) ? intval($a->argv[2]) : 0 ); @@ -57,7 +57,7 @@ function pubsub_init(App &$a) { $sql_extra = ((strlen($hub_verify)) ? sprintf(" AND `hub-verify` = '%s' ", dbesc($hub_verify)) : ''); - $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d + $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d AND `blocked` = 0 AND `pending` = 0 $sql_extra LIMIT 1", intval($contact_id), intval($owner['uid']) @@ -75,7 +75,7 @@ function pubsub_init(App &$a) { $contact = $r[0]; - // We must initiate an unsubscribe request with a verify_token. + // We must initiate an unsubscribe request with a verify_token. // Don't allow outsiders to unsubscribe us. if($hub_mode === 'unsubscribe') { @@ -98,7 +98,7 @@ function pubsub_init(App &$a) { require_once('include/security.php'); -function pubsub_post(App &$a) { +function pubsub_post(App $a) { $xml = file_get_contents('php://input'); diff --git a/mod/pubsubhubbub.php b/mod/pubsubhubbub.php index a6c36631a..dceb16ae1 100644 --- a/mod/pubsubhubbub.php +++ b/mod/pubsubhubbub.php @@ -4,7 +4,7 @@ function post_var($name) { return (x($_POST, $name)) ? notags(trim($_POST[$name])) : ''; } -function pubsubhubbub_init(App &$a) { +function pubsubhubbub_init(App $a) { // PuSH subscription must be considered "public" so just block it // if public access isn't enabled. if (get_config('system', 'block_public')) { diff --git a/mod/qsearch.php b/mod/qsearch.php index 118c93d9f..8512bea51 100644 --- a/mod/qsearch.php +++ b/mod/qsearch.php @@ -1,6 +1,6 @@ diff --git a/mod/salmon.php b/mod/salmon.php index 6c3aea211..69809f523 100644 --- a/mod/salmon.php +++ b/mod/salmon.php @@ -19,7 +19,7 @@ function salmon_return($val) { } -function salmon_post(App &$a) { +function salmon_post(App $a) { $xml = file_get_contents('php://input'); @@ -156,7 +156,7 @@ function salmon_post(App &$a) { if(get_pconfig($importer['uid'],'system','ostatus_autofriend')) { $result = new_contact($importer['uid'],$author_link); if($result['success']) { - $r = q("SELECT * FROM `contact` WHERE `network` = '%s' AND ( `url` = '%s' OR `alias` = '%s') + $r = q("SELECT * FROM `contact` WHERE `network` = '%s' AND ( `url` = '%s' OR `alias` = '%s') AND `uid` = %d LIMIT 1", dbesc(NETWORK_OSTATUS), dbesc($author_link), diff --git a/mod/search.php b/mod/search.php index 22879f7f9..df604e367 100644 --- a/mod/search.php +++ b/mod/search.php @@ -43,7 +43,7 @@ function search_saved_searches() { } -function search_init(App &$a) { +function search_init(App $a) { $search = ((x($_GET,'search')) ? notags(trim(rawurldecode($_GET['search']))) : ''); @@ -81,13 +81,13 @@ function search_init(App &$a) { -function search_post(App &$a) { +function search_post(App $a) { if(x($_POST,'search')) $a->data['search'] = $_POST['search']; } -function search_content(App &$a) { +function search_content(App $a) { if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) { notice( t('Public access denied.') . EOL); diff --git a/mod/session.php b/mod/session.php index 22c855edb..a73bcc78f 100644 --- a/mod/session.php +++ b/mod/session.php @@ -1,5 +1,5 @@ argc > 1) ? intval($a->argv[1]) : 0); if((! $post_id) || (! local_user())) killme(); - $r = q("SELECT item.*, contact.network FROM `item` - inner join contact on `item`.`contact-id` = `contact`.`id` + $r = q("SELECT item.*, contact.network FROM `item` + inner join contact on `item`.`contact-id` = `contact`.`id` WHERE `item`.`id` = %d AND `item`.`uid` = %d LIMIT 1", intval($post_id), diff --git a/mod/smilies.php b/mod/smilies.php index 8e04d5d05..4d8ab6bca 100644 --- a/mod/smilies.php +++ b/mod/smilies.php @@ -6,7 +6,7 @@ require_once("include/Smilies.php"); -function smilies_content(App &$a) { +function smilies_content(App $a) { if ($a->argv[1]==="json"){ $tmp = Smilies::get_list(); $results = array(); diff --git a/mod/starred.php b/mod/starred.php index c23b07b8b..46d3fcff6 100644 --- a/mod/starred.php +++ b/mod/starred.php @@ -1,7 +1,7 @@ tab where wanted -function uexport_content(App &$a){ +function uexport_content(App $a) { if ($a->argc > 1) { header("Content-type: application/json"); @@ -124,7 +124,7 @@ function uexport_account($a){ /** * echoes account data and items as separated json, one per line */ -function uexport_all(App &$a) { +function uexport_all(App $a) { uexport_account($a); echo "\n"; diff --git a/mod/uimport.php b/mod/uimport.php index 15bc8322b..e9934393e 100644 --- a/mod/uimport.php +++ b/mod/uimport.php @@ -6,7 +6,7 @@ require_once("include/uimport.php"); -function uimport_post(App &$a) { +function uimport_post(App $a) { switch($a->config['register_policy']) { case REGISTER_OPEN: $blocked = 0; @@ -28,7 +28,7 @@ function uimport_post(App &$a) { $verified = 0; break; } - + if (x($_FILES,'accountfile')){ /// @TODO Pass $blocked / $verified, send email to admin on REGISTER_APPROVE import_account($a, $_FILES['accountfile']); @@ -36,8 +36,8 @@ function uimport_post(App &$a) { } } -function uimport_content(App &$a) { - +function uimport_content(App $a) { + if((! local_user()) && ($a->config['register_policy'] == REGISTER_CLOSED)) { notice("Permission denied." . EOL); return; @@ -52,8 +52,8 @@ function uimport_content(App &$a) { return; } } - - + + if(x($_SESSION,'theme')) unset($_SESSION['theme']); if(x($_SESSION,'mobile-theme')) diff --git a/mod/update_community.php b/mod/update_community.php index 179e9c61c..9a39489dc 100644 --- a/mod/update_community.php +++ b/mod/update_community.php @@ -4,7 +4,7 @@ require_once("mod/community.php"); -function update_community_content(App &$a) { +function update_community_content(App $a) { header("Content-type: text/html"); echo "\r\n"; diff --git a/mod/update_display.php b/mod/update_display.php index 230bbaa0b..86f4db825 100644 --- a/mod/update_display.php +++ b/mod/update_display.php @@ -5,7 +5,7 @@ require_once("mod/display.php"); require_once("include/group.php"); -function update_display_content(App &$a) { +function update_display_content(App $a) { $profile_uid = intval($_GET["p"]); diff --git a/mod/update_network.php b/mod/update_network.php index c6d33132c..869973ace 100644 --- a/mod/update_network.php +++ b/mod/update_network.php @@ -5,7 +5,7 @@ require_once("mod/network.php"); require_once("include/group.php"); -function update_network_content(App &$a) { +function update_network_content(App $a) { $profile_uid = intval($_GET["p"]); diff --git a/mod/update_notes.php b/mod/update_notes.php index b21f69805..d27cc4ca9 100644 --- a/mod/update_notes.php +++ b/mod/update_notes.php @@ -7,7 +7,7 @@ require_once("mod/notes.php"); -function update_notes_content(App &$a) { +function update_notes_content(App $a) { $profile_uid = intval($_GET["p"]); diff --git a/mod/update_profile.php b/mod/update_profile.php index e16b0b5cc..b77a9cdcf 100644 --- a/mod/update_profile.php +++ b/mod/update_profile.php @@ -7,7 +7,7 @@ require_once("mod/profile.php"); -function update_profile_content(App &$a) { +function update_profile_content(App $a) { $profile_uid = intval($_GET["p"]); diff --git a/mod/videos.php b/mod/videos.php index 433ce5fc6..3828b8f1f 100644 --- a/mod/videos.php +++ b/mod/videos.php @@ -6,7 +6,7 @@ require_once('include/security.php'); require_once('include/redir.php'); -function videos_init(App &$a) { +function videos_init(App $a) { if($a->argc > 1) auto_redir($a, $a->argv[1]); @@ -102,7 +102,7 @@ function videos_init(App &$a) { -function videos_post(App &$a) { +function videos_post(App $a) { $owner_uid = $a->data['user']['uid']; @@ -182,7 +182,7 @@ function videos_post(App &$a) { -function videos_content(App &$a) { +function videos_content(App $a) { // URLs (most aren't currently implemented): // videos/name diff --git a/mod/viewcontacts.php b/mod/viewcontacts.php index 9c72a46e9..55afda9b6 100644 --- a/mod/viewcontacts.php +++ b/mod/viewcontacts.php @@ -2,7 +2,7 @@ require_once('include/Contact.php'); require_once('include/contact_selectors.php'); -function viewcontacts_init(App &$a) { +function viewcontacts_init(App $a) { if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) { return; @@ -29,7 +29,7 @@ function viewcontacts_init(App &$a) { } -function viewcontacts_content(App &$a) { +function viewcontacts_content(App $a) { require_once("mod/proxy.php"); if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) { diff --git a/mod/viewsrc.php b/mod/viewsrc.php index 8510bd539..a3f0affb5 100644 --- a/mod/viewsrc.php +++ b/mod/viewsrc.php @@ -1,7 +1,7 @@ $user['nickname'], '$linkurl' => t('Please enter a link URL:') )); - - + + $tpl = get_markup_template('wallmessage.tpl'); $o .= replace_macros($tpl,array( '$header' => t('Send Private Message'), diff --git a/mod/webfinger.php b/mod/webfinger.php index f08451ba7..eee0580e3 100644 --- a/mod/webfinger.php +++ b/mod/webfinger.php @@ -1,7 +1,7 @@ Webfinger Diagnostic'; diff --git a/mod/xrd.php b/mod/xrd.php index a56c7fbdf..7b812a7f9 100644 --- a/mod/xrd.php +++ b/mod/xrd.php @@ -2,7 +2,7 @@ require_once('include/crypto.php'); -function xrd_init(App &$a) { +function xrd_init(App $a) { $uri = urldecode(notags(trim($_GET['uri'])));