From 4dce3d822470537e40a0f77330d62ac05bf73806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Tue, 20 Dec 2016 10:58:55 +0100 Subject: [PATCH] changed to this: --------------------- function bla (App &$a) { $a->bla = 'stuff'; } --------------------- MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- mod/_well_known.php | 5 +++-- mod/acctlink.php | 2 +- mod/acl.php | 2 +- mod/admin.php | 34 +++++++++++++++++----------------- mod/allfriends.php | 4 ++-- mod/amcd.php | 2 +- mod/api.php | 4 ++-- mod/apps.php | 2 +- mod/attach.php | 2 +- mod/babel.php | 2 +- mod/bookmarklet.php | 4 ++-- mod/cal.php | 4 ++-- mod/cb.php | 8 ++++---- mod/common.php | 2 +- mod/community.php | 2 +- mod/contactgroup.php | 2 +- mod/contacts.php | 8 ++++---- mod/credits.php | 2 +- mod/crepair.php | 6 +++--- mod/delegate.php | 4 ++-- mod/dfrn_notify.php | 4 ++-- mod/dfrn_poll.php | 6 +++--- mod/dfrn_request.php | 6 +++--- mod/directory.php | 6 +++--- mod/dirfind.php | 2 +- mod/display.php | 2 +- mod/editpost.php | 2 +- mod/events.php | 26 +++++++++++++++----------- mod/fbrowser.php | 3 +-- mod/fetch.php | 2 +- mod/filer.php | 2 +- mod/filerm.php | 2 +- mod/follow.php | 4 ++-- mod/friendica.php | 4 ++-- mod/fsuggest.php | 4 ++-- mod/group.php | 6 +++--- mod/hcard.php | 2 +- mod/help.php | 2 +- mod/home.php | 4 ++-- mod/hostxrd.php | 2 +- mod/hovercard.php | 2 +- mod/ignored.php | 2 +- mod/install.php | 8 ++++---- mod/invite.php | 4 ++-- mod/item.php | 4 ++-- mod/like.php | 2 +- mod/localtime.php | 4 ++-- mod/lockview.php | 2 +- mod/login.php | 2 +- mod/lostpass.php | 4 ++-- mod/maintenance.php | 2 +- mod/manage.php | 4 ++-- mod/match.php | 2 +- mod/message.php | 8 ++++---- mod/modexp.php | 2 +- mod/mood.php | 4 ++-- mod/msearch.php | 2 +- mod/navigation.php | 2 +- mod/network.php | 8 ++++---- mod/newmember.php | 2 +- mod/nodeinfo.php | 4 ++-- mod/nogroup.php | 4 ++-- mod/noscrape.php | 2 +- mod/notes.php | 2 +- mod/notice.php | 2 +- mod/notifications.php | 4 ++-- mod/notify.php | 4 ++-- mod/oembed.php | 2 +- mod/oexchange.php | 4 ++-- mod/openid.php | 2 +- mod/opensearch.php | 2 +- mod/ostatus_subscribe.php | 2 +- mod/parse_url.php | 2 +- mod/photo.php | 2 +- mod/photos.php | 6 +++--- mod/poco.php | 2 +- mod/poke.php | 4 ++-- mod/post.php | 4 ++-- mod/pretheme.php | 2 +- mod/probe.php | 2 +- mod/profile.php | 2 +- mod/profile_photo.php | 6 +++--- mod/profiles.php | 6 +++--- mod/profperm.php | 4 ++-- mod/pubsub.php | 4 ++-- mod/pubsubhubbub.php | 2 +- mod/qsearch.php | 2 +- mod/randprof.php | 2 +- mod/receive.php | 2 +- mod/redir.php | 2 +- 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 | 2 +- mod/search.php | 6 +++--- mod/settings.php | 6 +++--- mod/share.php | 2 +- mod/smilies.php | 2 +- mod/starred.php | 2 +- mod/statistics_json.php | 2 +- mod/subthread.php | 2 +- mod/suggest.php | 4 ++-- mod/tagger.php | 2 +- mod/tagrm.php | 4 ++-- mod/toggle_mobile.php | 2 +- mod/uexport.php | 6 +++--- mod/uimport.php | 5 +++-- 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 | 2 +- mod/wall_attach.php | 2 +- mod/wallmessage.php | 4 ++-- mod/webfinger.php | 2 +- mod/xrd.php | 2 +- 121 files changed, 225 insertions(+), 220 deletions(-) diff --git a/mod/_well_known.php b/mod/_well_known.php index 33070a1ec..eedddf1e5 100644 --- a/mod/_well_known.php +++ b/mod/_well_known.php @@ -1,8 +1,9 @@ argc > 1) { switch($a->argv[1]) { case "host-meta": @@ -20,7 +21,7 @@ function _well_known_init(&$a){ killme(); } -function wk_social_relay(&$a) { +function wk_social_relay(App &$a) { define('SR_SCOPE_ALL', 'all'); define('SR_SCOPE_TAGS', 'tags'); diff --git a/mod/acctlink.php b/mod/acctlink.php index a2365803a..29f17d6e4 100644 --- a/mod/acctlink.php +++ b/mod/acctlink.php @@ -2,7 +2,7 @@ require_once('include/Scrape.php'); -function acctlink_init(&$a) { +function acctlink_init(App &$a) { if(x($_GET,'addr')) { $addr = trim($_GET['addr']); diff --git a/mod/acl.php b/mod/acl.php index f5e04b96a..802b0a399 100644 --- a/mod/acl.php +++ b/mod/acl.php @@ -3,7 +3,7 @@ require_once("include/acl_selectors.php"); -function acl_init(&$a){ +function acl_init(App &$a){ acl_lookup($a); } diff --git a/mod/admin.php b/mod/admin.php index b4495a194..040f55a5a 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -23,7 +23,7 @@ require_once("include/text.php"); * @param App $a * */ -function admin_post(&$a){ +function admin_post(App &$a){ if(!is_site_admin()) { @@ -127,7 +127,7 @@ function admin_post(&$a){ * @param App $a * @return string */ -function admin_content(&$a) { +function admin_content(App &$a) { if(!is_site_admin()) { return login(false); @@ -260,7 +260,7 @@ function admin_content(&$a) { * @param App $a * @return string */ -function admin_page_federation(&$a) { +function admin_page_federation(App &$a) { // get counts on active friendica, diaspora, redmatrix, hubzilla, gnu // social and statusnet nodes this node is knowing // @@ -393,7 +393,7 @@ function admin_page_federation(&$a) { * @param App $a * @return string */ -function admin_page_queue(&$a) { +function admin_page_queue(App &$a) { // get content from the queue table $r = q("SELECT `c`.`name`, `c`.`nurl`, `q`.`id`, `q`.`network`, `q`.`created`, `q`.`last` FROM `queue` AS `q`, `contact` AS `c` @@ -427,7 +427,7 @@ function admin_page_queue(&$a) { * @param App $a * @return string */ -function admin_page_summary(&$a) { +function admin_page_summary(App &$a) { global $db; // are there MyISAM tables in the DB? If so, trigger a warning message $r = q("SELECT `engine` FROM `information_schema`.`tables` WHERE `engine` = 'myisam' AND `table_schema` = '%s' LIMIT 1", @@ -504,7 +504,7 @@ function admin_page_summary(&$a) { * * @param App $a */ -function admin_page_site_post(&$a) { +function admin_page_site_post(App &$a) { if(!x($_POST,"page_site")) { return; } @@ -845,7 +845,7 @@ function admin_page_site_post(&$a) { * @param App $a * @return string */ -function admin_page_site(&$a) { +function admin_page_site(App &$a) { /* Installed langs */ $lang_choices = get_available_languages(); @@ -1072,7 +1072,7 @@ function admin_page_site(&$a) { * @param App $a * @return string **/ -function admin_page_dbsync(&$a) { +function admin_page_dbsync(App &$a) { $o = ''; @@ -1155,7 +1155,7 @@ function admin_page_dbsync(&$a) { * * @param App $a */ -function admin_page_users_post(&$a){ +function admin_page_users_post(App &$a){ $pending = (x($_POST, 'pending') ? $_POST['pending'] : array()); $users = (x($_POST, 'user') ? $_POST['user'] : array()); $nu_name = (x($_POST, 'new_user_name') ? $_POST['new_user_name'] : ''); @@ -1260,7 +1260,7 @@ function admin_page_users_post(&$a){ * @param App $a * @return string */ -function admin_page_users(&$a){ +function admin_page_users(App &$a){ if($a->argc>2) { $uid = $a->argv[3]; $user = q("SELECT `username`, `blocked` FROM `user` WHERE `uid` = %d", intval($uid)); @@ -1460,7 +1460,7 @@ function admin_page_users(&$a){ * @param App $a * @return string */ -function admin_page_plugins(&$a){ +function admin_page_plugins(App &$a){ /* * Single plugin @@ -1666,7 +1666,7 @@ function rebuild_theme_table($themes) { * @param App $a * @return string */ -function admin_page_themes(&$a){ +function admin_page_themes(App &$a){ $allowed_themes_str = get_config('system','allowed_themes'); $allowed_themes_raw = explode(',',$allowed_themes_str); @@ -1847,7 +1847,7 @@ function admin_page_themes(&$a){ * * @param App $a */ -function admin_page_logs_post(&$a) { +function admin_page_logs_post(App &$a) { if(x($_POST,"page_logs")) { check_form_security_token_redirectOnErr('/admin/logs', 'admin_logs'); @@ -1881,7 +1881,7 @@ function admin_page_logs_post(&$a) { * @param App $a * @return string */ -function admin_page_logs(&$a){ +function admin_page_logs(App &$a){ $log_choices = array( LOGGER_NORMAL => 'Normal', @@ -1938,7 +1938,7 @@ function admin_page_logs(&$a){ * @param App $a * @return string */ -function admin_page_viewlogs(&$a){ +function admin_page_viewlogs(App &$a){ $t = get_markup_template("admin_viewlogs.tpl"); $f = get_config('system','logfile'); $data = ''; @@ -1980,7 +1980,7 @@ function admin_page_viewlogs(&$a){ * * @param App $a */ -function admin_page_features_post(&$a) { +function admin_page_features_post(App &$a) { check_form_security_token_redirectOnErr('/admin/features', 'admin_manage_features'); @@ -2026,7 +2026,7 @@ function admin_page_features_post(&$a) { * @param App $a * @return string */ -function admin_page_features(&$a) { +function admin_page_features(App &$a) { if((argc() > 1) && (argv(1) === 'features')) { $arr = array(); diff --git a/mod/allfriends.php b/mod/allfriends.php index e4f067eaf..43490e964 100644 --- a/mod/allfriends.php +++ b/mod/allfriends.php @@ -5,7 +5,7 @@ require_once('include/Contact.php'); require_once('include/contact_selectors.php'); require_once('mod/contacts.php'); -function allfriends_content(&$a) { +function allfriends_content(App &$a) { $o = ''; if(! local_user()) { @@ -19,7 +19,7 @@ function allfriends_content(&$a) { if(! $cid) return; - $uid = $a->user[uid]; + $uid = $a->user['uid']; $c = q("SELECT `name`, `url`, `photo` FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1", intval($cid), diff --git a/mod/amcd.php b/mod/amcd.php index a2a1327e6..3fcdb42c8 100644 --- a/mod/amcd.php +++ b/mod/amcd.php @@ -1,6 +1,6 @@ cmd=='api/oauth/authorize'){ /* * api/oauth/authorize interact with the user. return a standard page diff --git a/mod/apps.php b/mod/apps.php index a821ef5d5..4d6395e4e 100644 --- a/mod/apps.php +++ b/mod/apps.php @@ -1,6 +1,6 @@ argc != 2) { notice( t('Item not available.') . EOL); diff --git a/mod/babel.php b/mod/babel.php index d31e090c5..5129f5bf5 100644 --- a/mod/babel.php +++ b/mod/babel.php @@ -9,7 +9,7 @@ function visible_lf($s) { return str_replace("\n",'
', $s); } -function babel_content(&$a) { +function babel_content(App &$a) { $o .= '

Babel Diagnostic

'; diff --git a/mod/bookmarklet.php b/mod/bookmarklet.php index cb8320013..1d6806943 100644 --- a/mod/bookmarklet.php +++ b/mod/bookmarklet.php @@ -3,11 +3,11 @@ require_once('include/conversation.php'); require_once('include/items.php'); -function bookmarklet_init(&$a) { +function bookmarklet_init(App &$a) { $_GET["mode"] = "minimal"; } -function bookmarklet_content(&$a) { +function bookmarklet_content(App &$a) { if(!local_user()) { $o = '

'.t('Login').'

'; $o .= login(($a->config['register_policy'] == REGISTER_CLOSED) ? false : true); diff --git a/mod/cal.php b/mod/cal.php index 8b8dbed95..48ba06ed6 100644 --- a/mod/cal.php +++ b/mod/cal.php @@ -9,7 +9,7 @@ require_once('include/event.php'); require_once('include/redir.php'); -function cal_init(&$a) { +function cal_init(App &$a) { if($a->argc > 1) auto_redir($a, $a->argv[1]); @@ -64,7 +64,7 @@ function cal_init(&$a) { return; } -function cal_content(&$a) { +function cal_content(App &$a) { nav_set_selected('events'); $editselect = 'none'; diff --git a/mod/cb.php b/mod/cb.php index 6375d2398..90e41fb6d 100644 --- a/mod/cb.php +++ b/mod/cb.php @@ -5,19 +5,19 @@ */ -function cb_init(&$a) { +function cb_init(App &$a) { call_hooks('cb_init'); } -function cb_post(&$a) { +function cb_post(App &$a) { call_hooks('cb_post', $_POST); } -function cb_afterpost(&$a) { +function cb_afterpost(App &$a) { call_hooks('cb_afterpost'); } -function cb_content(&$a) { +function cb_content(App &$a) { $o = ''; call_hooks('cb_content', $o); return $o; diff --git a/mod/common.php b/mod/common.php index 9781d1607..e0cd65506 100644 --- a/mod/common.php +++ b/mod/common.php @@ -5,7 +5,7 @@ require_once('include/Contact.php'); require_once('include/contact_selectors.php'); require_once('mod/contacts.php'); -function common_content(&$a) { +function common_content(App &$a) { $o = ''; diff --git a/mod/community.php b/mod/community.php index c8f04d8bd..7a1e72733 100644 --- a/mod/community.php +++ b/mod/community.php @@ -1,6 +1,6 @@ argc > 1) $which = $a->argv[1]; @@ -42,7 +42,7 @@ function dfrn_request_init(&$a) { * After logging in, we click 'submit' to approve the linkage. * */ -function dfrn_request_post(&$a) { +function dfrn_request_post(App &$a) { if(($a->argc != 2) || (! count($a->profile))) { logger('Wrong count of argc or profiles: argc=' . $a->argc . ',profile()=' . count($a->profile)); @@ -654,7 +654,7 @@ function dfrn_request_post(&$a) { } -function dfrn_request_content(&$a) { +function dfrn_request_content(App &$a) { if (($a->argc != 2) || (! count($a->profile))) { return ""; diff --git a/mod/directory.php b/mod/directory.php index ddea650de..c702acf37 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -1,6 +1,6 @@ set_pager_itemspage(60); if(local_user()) { @@ -20,14 +20,14 @@ function directory_init(&$a) { } -function directory_post(&$a) { +function directory_post(App &$a) { if(x($_POST,'search')) $a->data['search'] = $_POST['search']; } -function directory_content(&$a) { +function directory_content(App &$a) { global $db; require_once("mod/proxy.php"); diff --git a/mod/dirfind.php b/mod/dirfind.php index 1e3f6f354..80cba1c47 100644 --- a/mod/dirfind.php +++ b/mod/dirfind.php @@ -5,7 +5,7 @@ require_once('include/Contact.php'); require_once('include/contact_selectors.php'); require_once('mod/contacts.php'); -function dirfind_init(&$a) { +function dirfind_init(App &$a) { if(! local_user()) { notice( t('Permission denied.') . EOL ); diff --git a/mod/display.php b/mod/display.php index 6ebe16ae8..c98d936a0 100644 --- a/mod/display.php +++ b/mod/display.php @@ -1,6 +1,6 @@ argc == 1) { + if ($a->argc == 1) { // if it's a json request abort here becaus we don't // need the widget data if($a->argv[1] === 'json') @@ -20,8 +20,9 @@ function events_init(&$a) { $cal_widget = widget_events(); - if(! x($a->page,'aside')) + if (! x($a->page,'aside')) { $a->page['aside'] = ''; + } $a->page['aside'] .= $cal_widget; } @@ -29,7 +30,7 @@ function events_init(&$a) { return; } -function events_post(&$a) { +function events_post(App &$a) { logger('post: ' . print_r($_REQUEST,true)); @@ -184,38 +185,41 @@ function events_post(&$a) { -function events_content(&$a) { +function events_content(App &$a) { if(! local_user()) { notice( t('Permission denied.') . EOL); return; } - if($a->argc == 1) + if ($a->argc == 1) { $_SESSION['return_url'] = App::get_baseurl() . '/' . $a->cmd; + } - if(($a->argc > 2) && ($a->argv[1] === 'ignore') && intval($a->argv[2])) { + if (($a->argc > 2) && ($a->argv[1] === 'ignore') && intval($a->argv[2])) { $r = q("update event set ignore = 1 where id = %d and uid = %d", intval($a->argv[2]), intval(local_user()) ); } - if(($a->argc > 2) && ($a->argv[1] === 'unignore') && intval($a->argv[2])) { + if (($a->argc > 2) && ($a->argv[1] === 'unignore') && intval($a->argv[2])) { $r = q("update event set ignore = 0 where id = %d and uid = %d", intval($a->argv[2]), intval(local_user()) ); } - if ($a->theme_events_in_profile) + if ($a->theme_events_in_profile) { nav_set_selected('home'); - else + } else { nav_set_selected('events'); + } $editselect = 'none'; - if( feature_enabled(local_user(), 'richtext') ) + if ( feature_enabled(local_user(), 'richtext') ) { $editselect = 'textareas'; + } // get the translation strings for the callendar $i18n = get_event_strings(); diff --git a/mod/fbrowser.php b/mod/fbrowser.php index 6af97368f..8c54a47ba 100644 --- a/mod/fbrowser.php +++ b/mod/fbrowser.php @@ -10,8 +10,7 @@ require_once('include/Photo.php'); /** * @param App $a */ -/// @TODO & is missing or App ? -function fbrowser_content($a){ +function fbrowser_content(App &$a){ if (!local_user()) killme(); diff --git a/mod/fetch.php b/mod/fetch.php index 04bdf5188..bf27ffb6a 100644 --- a/mod/fetch.php +++ b/mod/fetch.php @@ -8,7 +8,7 @@ require_once("include/xml.php"); /// @TODO You always make it like this: function foo(&$a) /// @TODO This means that the value of $a can be changed in anything, remove & and use App as type-hint -function fetch_init(&$a){ +function fetch_init(App &$a){ if (($a->argc != 3) OR (!in_array($a->argv[1], array("post", "status_message", "reshare")))) { header($_SERVER["SERVER_PROTOCOL"].' 404 '.t('Not Found')); diff --git a/mod/filer.php b/mod/filer.php index 4e79f337d..4198502c4 100644 --- a/mod/filer.php +++ b/mod/filer.php @@ -5,7 +5,7 @@ require_once('include/bbcode.php'); require_once('include/items.php'); -function filer_content(&$a) { +function filer_content(App &$a) { if(! local_user()) { killme(); diff --git a/mod/filerm.php b/mod/filerm.php index c266082c8..e109ed404 100644 --- a/mod/filerm.php +++ b/mod/filerm.php @@ -1,6 +1,6 @@ argv[1]=="json"){ $register_policy = Array('REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN'); @@ -59,7 +59,7 @@ function friendica_init(&$a) { -function friendica_content(&$a) { +function friendica_content(App &$a) { $o = ''; $o .= '

Friendica

'; diff --git a/mod/fsuggest.php b/mod/fsuggest.php index 4370952ca..9d862848f 100644 --- a/mod/fsuggest.php +++ b/mod/fsuggest.php @@ -1,7 +1,7 @@ page['aside'] = group_side('contacts','group','extended',(($a->argc > 1) ? intval($a->argv[1]) : 0)); @@ -13,7 +13,7 @@ function group_init(&$a) { -function group_post(&$a) { +function group_post(App &$a) { if(! local_user()) { notice( t('Permission denied.') . EOL); @@ -65,7 +65,7 @@ function group_post(&$a) { return; } -function group_content(&$a) { +function group_content(App &$a) { $change = false; if(! local_user()) { diff --git a/mod/hcard.php b/mod/hcard.php index 366986344..1d51ac80e 100644 --- a/mod/hcard.php +++ b/mod/hcard.php @@ -1,6 +1,6 @@ argc==2 && $a->argv[1]=="testrewrite") { @@ -25,7 +25,7 @@ function install_init(&$a){ } -function install_post(&$a) { +function install_post(App &$a) { global $install_wizard_pass, $db; switch($install_wizard_pass) { @@ -131,7 +131,7 @@ function get_db_errno() { return mysql_errno(); } -function install_content(&$a) { +function install_content(App &$a) { global $install_wizard_pass, $db; $o = ''; @@ -560,7 +560,7 @@ function check_imagik(&$checks) { -function manual_config(&$a) { +function manual_config(App &$a) { $data = htmlentities($a->data['txt'],ENT_COMPAT,'UTF-8'); $o = t('The database configuration file ".htconfig.php" could not be written. Please use the enclosed text to create a configuration file in your web server root.'); $o .= ""; diff --git a/mod/invite.php b/mod/invite.php index 5964acac4..79b30d6e4 100644 --- a/mod/invite.php +++ b/mod/invite.php @@ -9,7 +9,7 @@ require_once('include/email.php'); -function invite_post(&$a) { +function invite_post(App &$a) { if(! local_user()) { notice( t('Permission denied.') . EOL); @@ -95,7 +95,7 @@ function invite_post(&$a) { } -function invite_content(&$a) { +function invite_content(App &$a) { if(! local_user()) { notice( t('Permission denied.') . EOL); diff --git a/mod/item.php b/mod/item.php index 7bee5f3ea..a665c6ffe 100644 --- a/mod/item.php +++ b/mod/item.php @@ -27,7 +27,7 @@ require_once('include/Scrape.php'); require_once('include/diaspora.php'); require_once('include/Contact.php'); -function item_post(&$a) { +function item_post(App &$a) { if((! local_user()) && (! remote_user()) && (! x($_REQUEST,'commenter'))) return; @@ -1065,7 +1065,7 @@ function item_post_return($baseurl, $api_source, $return_path) { -function item_content(&$a) { +function item_content(App &$a) { if((! local_user()) && (! remote_user())) return; diff --git a/mod/like.php b/mod/like.php index cbab9185e..ff1e238ac 100755 --- a/mod/like.php +++ b/mod/like.php @@ -5,7 +5,7 @@ require_once('include/bbcode.php'); require_once('include/items.php'); require_once('include/like.php'); -function like_content(&$a) { +function like_content(App &$a) { if(! local_user() && ! remote_user()) { return false; } diff --git a/mod/localtime.php b/mod/localtime.php index ce6bf84a1..00a7c5909 100644 --- a/mod/localtime.php +++ b/mod/localtime.php @@ -3,7 +3,7 @@ require_once('include/datetime.php'); -function localtime_post(&$a) { +function localtime_post(App &$a) { $t = $_REQUEST['time']; if(! $t) @@ -16,7 +16,7 @@ function localtime_post(&$a) { } -function localtime_content(&$a) { +function localtime_content(App &$a) { $t = $_REQUEST['time']; if(! $t) $t = 'now'; diff --git a/mod/lockview.php b/mod/lockview.php index 68b5d30cf..746df28cd 100644 --- a/mod/lockview.php +++ b/mod/lockview.php @@ -1,7 +1,7 @@ argc > 1) ? $a->argv[1] : 0); if (is_numeric($type)) { diff --git a/mod/login.php b/mod/login.php index d09fc1868..db49ba20a 100644 --- a/mod/login.php +++ b/mod/login.php @@ -1,6 +1,6 @@ query_string; - if($a->argc == 1) { + if ($a->argc == 1) { // List messages diff --git a/mod/modexp.php b/mod/modexp.php index 3729e3236..5fc701290 100644 --- a/mod/modexp.php +++ b/mod/modexp.php @@ -2,7 +2,7 @@ require_once('library/asn1.php'); -function modexp_init(&$a) { +function modexp_init(App &$a) { if($a->argc != 2) killme(); diff --git a/mod/mood.php b/mod/mood.php index e378b9d0a..e98c16108 100644 --- a/mod/mood.php +++ b/mod/mood.php @@ -5,7 +5,7 @@ require_once('include/bbcode.php'); require_once('include/items.php'); -function mood_init(&$a) { +function mood_init(App &$a) { if(! local_user()) return; @@ -108,7 +108,7 @@ function mood_init(&$a) { -function mood_content(&$a) { +function mood_content(App &$a) { if(! local_user()) { notice( t('Permission denied.') . EOL); diff --git a/mod/msearch.php b/mod/msearch.php index ba7a92d64..4b5205ac0 100644 --- a/mod/msearch.php +++ b/mod/msearch.php @@ -1,6 +1,6 @@ argc >= 2 && is_numeric($a->argv[1])) { @@ -810,7 +810,7 @@ function network_content(&$a, $update = 0) { * @param app $a The global App * @return string Html of the networktab */ -function network_tabs($a) { +function network_tabs(App &$a) { // item filter tabs /// @TODO fix this logic, reduce duplication /// $a->page['content'] .= '
'; diff --git a/mod/newmember.php b/mod/newmember.php index aa55c3a09..1ef098506 100644 --- a/mod/newmember.php +++ b/mod/newmember.php @@ -1,6 +1,6 @@ ' . t('Welcome to Friendica') . ''; diff --git a/mod/nodeinfo.php b/mod/nodeinfo.php index e55dba128..104fecb75 100644 --- a/mod/nodeinfo.php +++ b/mod/nodeinfo.php @@ -7,7 +7,7 @@ require_once("include/plugin.php"); -function nodeinfo_wellknown(&$a) { +function nodeinfo_wellknown(App &$a) { if (!get_config("system", "nodeinfo")) { http_status_exit(404); killme(); @@ -20,7 +20,7 @@ function nodeinfo_wellknown(&$a) { exit; } -function nodeinfo_init(&$a){ +function nodeinfo_init(App &$a){ if (!get_config("system", "nodeinfo")) { http_status_exit(404); killme(); diff --git a/mod/nogroup.php b/mod/nogroup.php index 0a014c067..3cf02069d 100644 --- a/mod/nogroup.php +++ b/mod/nogroup.php @@ -4,7 +4,7 @@ require_once('include/Contact.php'); require_once('include/socgraph.php'); require_once('include/contact_selectors.php'); -function nogroup_init(&$a) { +function nogroup_init(App &$a) { if(! local_user()) return; @@ -19,7 +19,7 @@ function nogroup_init(&$a) { } -function nogroup_content(&$a) { +function nogroup_content(App &$a) { if(! local_user()) { notice( t('Permission denied.') . EOL); diff --git a/mod/noscrape.php b/mod/noscrape.php index 98d491bca..f1370167c 100644 --- a/mod/noscrape.php +++ b/mod/noscrape.php @@ -1,6 +1,6 @@ argc > 1) $which = $a->argv[1]; diff --git a/mod/notes.php b/mod/notes.php index 74ab18a6f..f50f41eaf 100644 --- a/mod/notes.php +++ b/mod/notes.php @@ -1,6 +1,6 @@ friendica items permanent-url compatibility */ - function notice_init(&$a){ + function notice_init(App &$a){ $id = $a->argv[1]; $r = q("SELECT user.nickname FROM user LEFT JOIN item ON item.uid=user.uid WHERE item.id=%d", intval($id) diff --git a/mod/notifications.php b/mod/notifications.php index 3e0bd9cc4..e7f32a587 100644 --- a/mod/notifications.php +++ b/mod/notifications.php @@ -9,7 +9,7 @@ require_once("include/NotificationsManager.php"); require_once("include/contact_selectors.php"); require_once("include/network.php"); -function notifications_post(&$a) { +function notifications_post(App &$a) { if(! local_user()) { goaway(z_root()); @@ -65,7 +65,7 @@ function notifications_post(&$a) { } } -function notifications_content(&$a) { +function notifications_content(App &$a) { if(! local_user()) { notice( t('Permission denied.') . EOL); diff --git a/mod/notify.php b/mod/notify.php index 092639735..cd836dada 100644 --- a/mod/notify.php +++ b/mod/notify.php @@ -2,7 +2,7 @@ require_once('include/NotificationsManager.php'); -function notify_init(&$a) { +function notify_init(App &$a) { if(! local_user()) return; $nm = new NotificationsManager(); @@ -36,7 +36,7 @@ function notify_init(&$a) { } -function notify_content(&$a) { +function notify_content(App &$a) { if(! local_user()) return login(); $nm = new NotificationsManager(); diff --git a/mod/oembed.php b/mod/oembed.php index cb478cb86..1d6e6145c 100644 --- a/mod/oembed.php +++ b/mod/oembed.php @@ -1,7 +1,7 @@ query_string, LOGGER_ALL); if ($a->argv[1]=='b2h'){ diff --git a/mod/oexchange.php b/mod/oexchange.php index b25c418e4..83b9453f2 100644 --- a/mod/oexchange.php +++ b/mod/oexchange.php @@ -1,7 +1,7 @@ argc > 1) && ($a->argv[1] === 'xrd')) { $tpl = get_markup_template('oexchange_xrd.tpl'); @@ -14,7 +14,7 @@ function oexchange_init(&$a) { } -function oexchange_content(&$a) { +function oexchange_content(App &$a) { if(! local_user()) { $o = login(false); diff --git a/mod/openid.php b/mod/openid.php index 9ee187767..e14b5f82d 100644 --- a/mod/openid.php +++ b/mod/openid.php @@ -4,7 +4,7 @@ require_once('library/openid.php'); -function openid_content(&$a) { +function openid_content(App &$a) { $noid = get_config('system','no_openid'); if($noid) diff --git a/mod/opensearch.php b/mod/opensearch.php index 50ecc4e69..1a7d4cd30 100644 --- a/mod/opensearch.php +++ b/mod/opensearch.php @@ -1,5 +1,5 @@ argc > 1) auto_redir($a, $a->argv[1]); @@ -112,7 +112,7 @@ function photos_init(&$a) { -function photos_post(&$a) { +function photos_post(App &$a) { logger('mod-photos: photos_post: begin' , LOGGER_DEBUG); @@ -928,7 +928,7 @@ function photos_post(&$a) { -function photos_content(&$a) { +function photos_content(App &$a) { // URLs: // photos/name diff --git a/mod/poco.php b/mod/poco.php index e454d1e66..787776b90 100644 --- a/mod/poco.php +++ b/mod/poco.php @@ -2,7 +2,7 @@ // See here for a documentation for portable contacts: // https://web.archive.org/web/20160405005550/http://portablecontacts.net/draft-spec.html -function poco_init(&$a) { +function poco_init(App &$a) { require_once("include/bbcode.php"); $system_mode = false; diff --git a/mod/poke.php b/mod/poke.php index fea5c0c0d..cc6d4ff89 100644 --- a/mod/poke.php +++ b/mod/poke.php @@ -19,7 +19,7 @@ require_once('include/bbcode.php'); require_once('include/items.php'); -function poke_init(&$a) { +function poke_init(App &$a) { if(! local_user()) return; @@ -144,7 +144,7 @@ function poke_init(&$a) { -function poke_content(&$a) { +function poke_content(App &$a) { if(! local_user()) { notice( t('Permission denied.') . EOL); diff --git a/mod/post.php b/mod/post.php index a8d345ecb..076587839 100644 --- a/mod/post.php +++ b/mod/post.php @@ -10,11 +10,11 @@ require_once('include/crypto.php'); // not yet ready for prime time //require_once('include/zot.php'); -function post_post(&$a) { +function post_post(App &$a) { $bulk_delivery = false; - if($a->argc == 1) { + if ($a->argc == 1) { $bulk_delivery = true; } else { diff --git a/mod/pretheme.php b/mod/pretheme.php index 4584cb29e..694fd5ba2 100644 --- a/mod/pretheme.php +++ b/mod/pretheme.php @@ -1,6 +1,6 @@ Probe Diagnostic'; diff --git a/mod/profile.php b/mod/profile.php index 20206c733..b7756453f 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -4,7 +4,7 @@ require_once('include/contact_widgets.php'); require_once('include/redir.php'); -function profile_init(&$a) { +function profile_init(App &$a) { if(! x($a->page,'aside')) $a->page['aside'] = ''; diff --git a/mod/profile_photo.php b/mod/profile_photo.php index 371effd0c..52cf6d26f 100644 --- a/mod/profile_photo.php +++ b/mod/profile_photo.php @@ -2,7 +2,7 @@ require_once("include/Photo.php"); -function profile_photo_init(&$a) { +function profile_photo_init(App &$a) { if(! local_user()) { return; @@ -13,7 +13,7 @@ function profile_photo_init(&$a) { } -function profile_photo_post(&$a) { +function profile_photo_post(App &$a) { if(! local_user()) { notice ( t('Permission denied.') . EOL ); @@ -169,7 +169,7 @@ function profile_photo_post(&$a) { if(! function_exists('profile_photo_content')) { -function profile_photo_content(&$a) { +function profile_photo_content(App &$a) { if(! local_user()) { notice( t('Permission denied.') . EOL ); diff --git a/mod/profiles.php b/mod/profiles.php index 44067032e..186d7a615 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(&$a) { +function profiles_init(App &$a) { nav_set_selected('profiles'); @@ -160,7 +160,7 @@ function profile_clean_keywords($keywords) { return $keywords; } -function profiles_post(&$a) { +function profiles_post(App &$a) { if(! local_user()) { notice( t('Permission denied.') . EOL); @@ -599,7 +599,7 @@ function profile_activity($changed, $value) { } -function profiles_content(&$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 aa610d3a9..694e2f4db 100644 --- a/mod/profperm.php +++ b/mod/profperm.php @@ -1,6 +1,6 @@ argc > 1) ? notags(trim($a->argv[1])) : ''); $contact_id = (($a->argc > 2) ? intval($a->argv[2]) : 0 ); @@ -98,7 +98,7 @@ function pubsub_init(&$a) { require_once('include/security.php'); -function pubsub_post(&$a) { +function pubsub_post(App &$a) { $xml = file_get_contents('php://input'); diff --git a/mod/pubsubhubbub.php b/mod/pubsubhubbub.php index bfe553c44..a6c36631a 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(&$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 a440ea708..b42b1cfd8 100644 --- a/mod/qsearch.php +++ b/mod/qsearch.php @@ -1,6 +1,6 @@ diff --git a/mod/salmon.php b/mod/salmon.php index ff5856a94..6c3aea211 100644 --- a/mod/salmon.php +++ b/mod/salmon.php @@ -19,7 +19,7 @@ function salmon_return($val) { } -function salmon_post(&$a) { +function salmon_post(App &$a) { $xml = file_get_contents('php://input'); diff --git a/mod/search.php b/mod/search.php index c19bb2767..3a2537626 100644 --- a/mod/search.php +++ b/mod/search.php @@ -43,7 +43,7 @@ function search_saved_searches() { } -function search_init(&$a) { +function search_init(App &$a) { $search = ((x($_GET,'search')) ? notags(trim(rawurldecode($_GET['search']))) : ''); @@ -81,13 +81,13 @@ function search_init(&$a) { -function search_post(&$a) { +function search_post(App &$a) { if(x($_POST,'search')) $a->data['search'] = $_POST['search']; } -function search_content(&$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/settings.php b/mod/settings.php index 3ea4d7acf..0d052cc1b 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -16,7 +16,7 @@ function get_theme_config_file($theme){ return null; } -function settings_init(&$a) { +function settings_init(App &$a) { if(! local_user()) { notice( t('Permission denied.') . EOL ); @@ -116,7 +116,7 @@ function settings_init(&$a) { } -function settings_post(&$a) { +function settings_post(App &$a) { if(! local_user()) return; @@ -652,7 +652,7 @@ function settings_post(&$a) { } -function settings_content(&$a) { +function settings_content(App &$a) { $o = ''; nav_set_selected('settings'); diff --git a/mod/share.php b/mod/share.php index 0a34c6fc5..f2e016708 100644 --- a/mod/share.php +++ b/mod/share.php @@ -1,5 +1,5 @@ argc > 1) ? intval($a->argv[1]) : 0); if((! $post_id) || (! local_user())) diff --git a/mod/smilies.php b/mod/smilies.php index 573cf17c8..8e04d5d05 100644 --- a/mod/smilies.php +++ b/mod/smilies.php @@ -6,7 +6,7 @@ require_once("include/Smilies.php"); -function smilies_content(&$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 0e5e75d16..f3fc5870e 100644 --- a/mod/starred.php +++ b/mod/starred.php @@ -1,7 +1,7 @@ argc > 1) { header("Content-type: application/json"); @@ -122,7 +122,7 @@ function uexport_account($a){ /** * echoes account data and items as separated json, one per line */ -function uexport_all(&$a) { +function uexport_all(App &$a) { uexport_account($a); echo "\n"; diff --git a/mod/uimport.php b/mod/uimport.php index 7ed5648d9..15bc8322b 100644 --- a/mod/uimport.php +++ b/mod/uimport.php @@ -1,11 +1,12 @@ config['register_policy']) { case REGISTER_OPEN: $blocked = 0; @@ -35,7 +36,7 @@ function uimport_post(&$a) { } } -function uimport_content(&$a) { +function uimport_content(App &$a) { if((! local_user()) && ($a->config['register_policy'] == REGISTER_CLOSED)) { notice("Permission denied." . EOL); diff --git a/mod/update_community.php b/mod/update_community.php index d5df7ba3b..179e9c61c 100644 --- a/mod/update_community.php +++ b/mod/update_community.php @@ -4,7 +4,7 @@ require_once("mod/community.php"); -function update_community_content(&$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 bd2a52934..230bbaa0b 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(&$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 258d03e32..c6d33132c 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(&$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 ee9d1d71f..b21f69805 100644 --- a/mod/update_notes.php +++ b/mod/update_notes.php @@ -7,7 +7,7 @@ require_once("mod/notes.php"); -function update_notes_content(&$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 1bc29d82c..e16b0b5cc 100644 --- a/mod/update_profile.php +++ b/mod/update_profile.php @@ -7,7 +7,7 @@ require_once("mod/profile.php"); -function update_profile_content(&$a) { +function update_profile_content(App &$a) { $profile_uid = intval($_GET["p"]); diff --git a/mod/videos.php b/mod/videos.php index 92e5fe554..eb5a2cee4 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(&$a) { +function videos_init(App &$a) { if($a->argc > 1) auto_redir($a, $a->argv[1]); @@ -102,7 +102,7 @@ function videos_init(&$a) { -function videos_post(&$a) { +function videos_post(App &$a) { $owner_uid = $a->data['user']['uid']; @@ -178,7 +178,7 @@ function videos_post(&$a) { -function videos_content(&$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 3fd5d79e1..6ae458b6a 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(&$a) { +function viewcontacts_init(App &$a) { if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) { return; @@ -29,7 +29,7 @@ function viewcontacts_init(&$a) { } -function viewcontacts_content(&$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 904b14425..ccb076970 100644 --- a/mod/viewsrc.php +++ b/mod/viewsrc.php @@ -1,7 +1,7 @@ Webfinger Diagnostic'; diff --git a/mod/xrd.php b/mod/xrd.php index 290c524a7..02a5d7b23 100644 --- a/mod/xrd.php +++ b/mod/xrd.php @@ -2,7 +2,7 @@ require_once('include/crypto.php'); -function xrd_init(&$a) { +function xrd_init(App &$a) { $uri = urldecode(notags(trim($_GET['uri'])));