diff --git a/blockem/blockem.php b/blockem/blockem.php index 3de7be40..7c1c4292 100644 --- a/blockem/blockem.php +++ b/blockem/blockem.php @@ -6,6 +6,8 @@ * Author: Mike Macgirvin * */ + +use Friendica\App; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; @@ -68,7 +70,7 @@ function blockem_addon_settings(&$a, &$s) } -function blockem_addon_settings_post(&$a,&$b) { +function blockem_addon_settings_post(App $a, $b) { if(! local_user()) return; @@ -79,7 +81,7 @@ function blockem_addon_settings_post(&$a,&$b) { } } -function blockem_enotify_store(&$a,&$b) { +function blockem_enotify_store(App $a, $b) { $words = PConfig::get($b['uid'],'blockem','words'); if($words) { @@ -107,7 +109,7 @@ function blockem_enotify_store(&$a,&$b) { } } -function blockem_prepare_body_content_filter(\Friendica\App $a, &$hook_data) +function blockem_prepare_body_content_filter(App $a, array &$hook_data) { if (!local_user()) { return; @@ -137,16 +139,17 @@ function blockem_prepare_body_content_filter(\Friendica\App $a, &$hook_data) } } -function blockem_display_item(&$a,&$b) { +function blockem_display_item(App $a, array &$b) { if (empty($b['output']['body'])) { return; } - if(strstr($b['output']['body'],'id="blockem-wrap-')) + if (strstr($b['output']['body'],'id="blockem-wrap-')) { $b['output']['thumb'] = $a->get_baseurl() . "/images/person-80.jpg"; + } } -function blockem_conversation_start(&$a,&$b) { +function blockem_conversation_start(App $a, $b) { if(! local_user()) return; @@ -174,7 +177,7 @@ EOT; } -function blockem_item_photo_menu(&$a,&$b) { +function blockem_item_photo_menu(App $a, $b) { if((! local_user()) || ($b['item']['self'])) return; diff --git a/blogger/blogger.php b/blogger/blogger.php index 30c450bd..1ca74e0c 100644 --- a/blogger/blogger.php +++ b/blogger/blogger.php @@ -6,6 +6,7 @@ * */ +use Friencia\App; use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\L10n; @@ -36,7 +37,7 @@ function blogger_uninstall() } -function blogger_jot_nets(&$a, &$b) +function blogger_jot_nets(App $a, array &$b) { if (!local_user()) { return; @@ -115,7 +116,7 @@ function blogger_settings(&$a, &$s) } -function blogger_settings_post(&$a, &$b) +function blogger_settings_post(App $a, array &$b) { if (x($_POST, 'blogger-submit')) { PConfig::set(local_user(), 'blogger', 'post', intval($_POST['blogger'])); @@ -126,7 +127,7 @@ function blogger_settings_post(&$a, &$b) } } -function blogger_post_local(&$a, &$b) +function blogger_post_local(App $a, array &$b) { // This can probably be changed to allow editing by pointing to a different API endpoint @@ -164,7 +165,7 @@ function blogger_post_local(&$a, &$b) -function blogger_send(&$a, &$b) +function blogger_send(App $a, array &$b) { if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) { return; diff --git a/buffer/buffer.php b/buffer/buffer.php index ef95f1d7..399d37a7 100644 --- a/buffer/buffer.php +++ b/buffer/buffer.php @@ -244,7 +244,7 @@ function buffer_post_local(&$a,&$b) { $b['postopts'] .= 'buffer'; } -function buffer_send(App $a, &$b) +function buffer_send(App $a, array &$b) { if($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) { return; diff --git a/buglink/buglink.php b/buglink/buglink.php index 71c22a67..4088cf8c 100644 --- a/buglink/buglink.php +++ b/buglink/buglink.php @@ -5,6 +5,8 @@ * Version: 1.0 * Author: Mike Macgirvin */ + +use Friencia\App; use Friendica\Core\Addon; use Friendica\Core\L10n; @@ -18,7 +20,7 @@ function buglink_uninstall() Addon::unregisterHook('page_end', 'addon/buglink/buglink.php', 'buglink_active'); } -function buglink_active(&$a, &$b) +function buglink_active(App $a, array &$b) { $b .= ''; } diff --git a/dwpost/dwpost.php b/dwpost/dwpost.php index a46f55b2..d95a97a5 100644 --- a/dwpost/dwpost.php +++ b/dwpost/dwpost.php @@ -8,6 +8,7 @@ * Author: Cat Gray */ +use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\L10n; @@ -33,7 +34,7 @@ function dwpost_uninstall() { } -function dwpost_jot_nets(&$a,&$b) { +function dwpost_jot_nets(App $a, $b) { if(! local_user()) return; @@ -47,7 +48,7 @@ function dwpost_jot_nets(&$a,&$b) { } -function dwpost_settings(&$a,&$s) { +function dwpost_settings(App $a, $s) { if(! local_user()) return; @@ -107,7 +108,7 @@ function dwpost_settings(&$a,&$s) { } -function dwpost_settings_post(&$a,&$b) { +function dwpost_settings_post(App $a, $b) { if(x($_POST,'dwpost-submit')) { @@ -120,7 +121,7 @@ function dwpost_settings_post(&$a,&$b) { } -function dwpost_post_local(&$a,&$b) { +function dwpost_post_local(App $a, $b) { // This can probably be changed to allow editing by pointing to a different API endpoint @@ -151,7 +152,7 @@ function dwpost_post_local(&$a,&$b) { -function dwpost_send(&$a,&$b) { +function dwpost_send(App $a, $b) { if($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) return; diff --git a/fortunate/fortunate.php b/fortunate/fortunate.php index ebece489..96cf34a3 100644 --- a/fortunate/fortunate.php +++ b/fortunate/fortunate.php @@ -6,6 +6,8 @@ * Author: Mike Macgirvin * Status: Unsupported */ + +use Friencia\App; use Friendica\Core\Addon; use Friendica\Util\Network; @@ -27,7 +29,7 @@ function fortunate_uninstall() } -function fortunate_fetch(&$a, &$b) +function fortunate_fetch(App $a, array &$b) { $a->page['htmlhead'] .= '' . "\r\n"; diff --git a/forumdirectory/forumdirectory.php b/forumdirectory/forumdirectory.php index a72c45ba..4c7f5d6c 100644 --- a/forumdirectory/forumdirectory.php +++ b/forumdirectory/forumdirectory.php @@ -6,6 +6,7 @@ * Author: Thomas Willingham */ +use Friencia\App; use Friendica\Content\Nav; use Friendica\Content\Widget; use Friendica\Core\Addon; @@ -34,7 +35,7 @@ function forumdirectory_module() return; } -function forumdirectory_app_menu($a, &$b) +function forumdirectory_app_menu(App $a, array &$b) { $b['app_menu'][] = ''; } diff --git a/fromgplus/fromgplus.php b/fromgplus/fromgplus.php index 0f208037..9bb64970 100644 --- a/fromgplus/fromgplus.php +++ b/fromgplus/fromgplus.php @@ -9,6 +9,7 @@ define('FROMGPLUS_DEFAULT_POLL_INTERVAL', 30); // given in minutes +use Friendica\App; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -38,7 +39,7 @@ function fromgplus_uninstall() { Addon::unregisterHook('addon_settings_post', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings_post'); } -function fromgplus_addon_settings(&$a,&$s) { +function fromgplus_addon_settings(App $a, $s) { if(! local_user()) return; @@ -79,7 +80,7 @@ class="settings-submit" value="' . L10n::t('Save Settings') . '" />'; return; } -function fromgplus_addon_settings_post(&$a,&$b) { +function fromgplus_addon_settings_post(App $a, $b) { if(! local_user()) return; @@ -213,11 +214,10 @@ function fromgplus_html2bbcode($html) { $bbcode = str_ireplace(["
"], ["\n"], $bbcode); $bbcode = trim(strip_tags($bbcode)); - return($bbcode); + return $bbcode; } -function fromgplus_parse_query($var) - { +function fromgplus_parse_query($var) { /** * Use this function to parse out the query array element from * the output of parse_url(). @@ -246,38 +246,47 @@ function fromgplus_cleanupgoogleproxy($fullImage, $image) { //$image = str_replace(array($preview, $preview2), array("/", "/"), $image->url); $image = $image->url; - $cleaned = []; + $cleaned = []; $queryvar = fromgplus_parse_query($fullImage); - if ($queryvar['url'] != "") - $cleaned["full"] = urldecode($queryvar['url']); - else + + if ($queryvar['url'] != "") { + $cleaned["full"] = urldecode($queryvar['url']); + } else { $cleaned["full"] = $fullImage; - if (@exif_imagetype($cleaned["full"]) == 0) + } + + if (exif_imagetype($cleaned["full"]) == 0) { $cleaned["full"] = ""; + } $queryvar = fromgplus_parse_query($image); - if ($queryvar['url'] != "") - $cleaned["preview"] = urldecode($queryvar['url']); - else + if ($queryvar['url'] != "") { + $cleaned["preview"] = urldecode($queryvar['url']); + } else { $cleaned["preview"] = $image; - if (@exif_imagetype($cleaned["preview"]) == 0) + } + + if (exif_imagetype($cleaned["preview"]) == 0) { $cleaned["preview"] = ""; + } if ($cleaned["full"] == "") { $cleaned["full"] = $cleaned["preview"]; $cleaned["preview"] = ""; } - if ($cleaned["full"] != "") + if ($cleaned["full"] != "") { $infoFull = Image::getInfoFromURL($cleaned["full"]); - else + } else { $infoFull = ["0" => 0, "1" => 0]; + } - if ($cleaned["preview"] != "") + if ($cleaned["preview"] != "") { $infoPreview = Image::getInfoFromURL($cleaned["preview"]); - else + } else { $infoFull = ["0" => 0, "1" => 0]; + } if (($infoPreview[0] >= $infoFull[0]) && ($infoPreview[1] >= $infoFull[1])) { $temp = $cleaned["full"]; @@ -285,21 +294,22 @@ function fromgplus_cleanupgoogleproxy($fullImage, $image) { $cleaned["preview"] = $temp; } - if (($cleaned["full"] == $cleaned["preview"]) || (($infoPreview[0] == $infoFull[0]) && ($infoPreview[1] == $infoFull[1]))) + if (($cleaned["full"] == $cleaned["preview"]) || (($infoPreview[0] == $infoFull[0]) && ($infoPreview[1] == $infoFull[1]))) { $cleaned["preview"] = ""; + } - if ($cleaned["full"] == "") - if (@exif_imagetype($fullImage) != 0) - $cleaned["full"] = $fullImage; + if ($cleaned["full"] == "" && exif_imagetype($fullImage) != 0) { + $cleaned["full"] = $fullImage; + } - if ($cleaned["full"] == "") - if (@exif_imagetype($image) != 0) - $cleaned["full"] = $image; + if ($cleaned["full"] == "" && exif_imagetype($image) != 0) + $cleaned["full"] = $image; + } // Could be changed in the future to a link to the album $cleaned["page"] = $cleaned["full"]; - return($cleaned); + return $cleaned; } function fromgplus_cleantext($text) { @@ -311,7 +321,7 @@ function fromgplus_cleantext($text) { $text = html_entity_decode($text, ENT_QUOTES); $text = trim($text); $text = str_replace(["\n", "\r", " ", $trash], ["", "", "", ""], $text); - return($text); + return $text; } function fromgplus_handleattachments($a, $uid, $item, $displaytext, $shared) { @@ -427,10 +437,11 @@ function fromgplus_handleattachments($a, $uid, $item, $displaytext, $shared) { } } - if ($pagedata["type"] != "") - return(add_page_info_data($pagedata)); + if ($pagedata["type"] != "") { + return add_page_info_data($pagedata); + } - return($post.$quote); + return ($post . $quote); } function fromgplus_fetch($a, $uid) { diff --git a/geocoordinates/geocoordinates.php b/geocoordinates/geocoordinates.php index 89ccd883..065f1b24 100644 --- a/geocoordinates/geocoordinates.php +++ b/geocoordinates/geocoordinates.php @@ -26,26 +26,32 @@ function geocoordinates_uninstall() function geocoordinates_resolve_item(&$item) { - if((!$item["coord"]) || ($item["location"])) + if((!x($item, 'coord')) || (x($item, 'location'))) return; $key = Config::get("geocoordinates", "api_key"); - if ($key == "") + + if ($key == "") { return; + } $language = Config::get("geocoordinates", "language"); - if ($language == "") + + if ($language == "") { $language = "de"; + } $coords = explode(' ',$item["coord"]); - if (count($coords) < 2) + if (count($coords) < 2) { return; + } $coords[0] = round($coords[0], 5); $coords[1] = round($coords[1], 5); $result = Cache::get("geocoordinates:".$language.":".$coords[0]."-".$coords[1]); + if (!is_null($result)) { $item["location"] = $result; return; @@ -53,7 +59,7 @@ function geocoordinates_resolve_item(&$item) $s = Network::fetchUrl("https://api.opencagedata.com/geocode/v1/json?q=".$coords[0].",".$coords[1]."&key=".$key."&language=".$language); - if (!$s) { + if ($s === FALSE) { logger("API could not be queried", LOGGER_DEBUG); return; } diff --git a/geonames/geonames.php b/geonames/geonames.php index 4cd1b27c..754e59e7 100644 --- a/geonames/geonames.php +++ b/geonames/geonames.php @@ -21,6 +21,8 @@ * system will call the name_uninstall() function. * */ + +use Friendica\App; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -166,7 +168,7 @@ function geonames_addon_admin_post($a,$post) { -function geonames_addon_admin(&$a,&$s) { +function geonames_addon_admin(App $a, $s) { if(! local_user()) return; diff --git a/googlemaps/googlemaps.php b/googlemaps/googlemaps.php index e294c8e0..54de7dee 100644 --- a/googlemaps/googlemaps.php +++ b/googlemaps/googlemaps.php @@ -6,6 +6,8 @@ * Author: Michael Vogel * */ + +use Friencia\App; use Friendica\Core\Addon; use Friendica\Core\Cache; @@ -23,20 +25,20 @@ function googlemaps_uninstall() logger("removed googlemaps"); } -function googlemaps_location($a, &$item) +function googlemaps_location(App $a, array &$item) { - if(! (strlen($item['location']) || strlen($item['coord']))) { + if (! (strlen($item['location']) || strlen($item['coord']))) { return; } - if ($item['coord'] != ""){ + if (x($item, 'coord')) { $target = "http://maps.google.com/?q=".urlencode($item['coord']); } else { $target = "http://maps.google.com/?q=".urlencode($item['location']); } - if ($item['location'] != "") { + if (x($item, 'location')) { $title = $item['location']; } else { $title = $item['coord']; diff --git a/gravatar/gravatar.php b/gravatar/gravatar.php index 7e5a918b..37e88462 100644 --- a/gravatar/gravatar.php +++ b/gravatar/gravatar.php @@ -5,6 +5,8 @@ * Version: 1.1 * Author: Klaus Weidenbach */ + +use Friencia\App; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -40,7 +42,7 @@ function gravatar_load_config(\Friendica\App $a) * @param $a array * @param &$b array */ -function gravatar_lookup($a, &$b) { +function gravatar_lookup(App $a, array &$b) { $default_avatar = Config::get('gravatar', 'default_avatar'); $rating = Config::get('gravatar', 'rating'); diff --git a/group_text/group_text.php b/group_text/group_text.php index 4c0cb14a..e7ef92fa 100644 --- a/group_text/group_text.php +++ b/group_text/group_text.php @@ -5,6 +5,8 @@ * Version: 1.0 * Author: Thomas Willingham */ + +use Friendica\App; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; @@ -56,7 +58,7 @@ function group_text_settings_post($a,$post) { -function group_text_settings(&$a,&$s) { +function group_text_settings(App $a, $s) { if(! local_user()) return; diff --git a/impressum/impressum.php b/impressum/impressum.php index 149b1395..310bfc7a 100644 --- a/impressum/impressum.php +++ b/impressum/impressum.php @@ -9,6 +9,7 @@ require_once 'mod/proxy.php'; +use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\Config; @@ -40,7 +41,7 @@ function obfuscate_email ($s) { $s = str_replace('.','(dot)',$s); return $s; } -function impressum_footer($a, &$b) { +function impressum_footer(App $a, array &$b) { $text = proxy_parse_html(BBCode::convert(Config::get('impressum','footer_text'))); if (! $text == '') { $a->page['htmlhead'] .= ''; diff --git a/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php b/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php index e92d3440..288b16bb 100644 --- a/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php +++ b/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php @@ -5,6 +5,8 @@ * Version: 1.0 * Author: Thomas Willingham */ + +use Friencia\App; use Friendica\Core\Addon; use Friendica\Core\L10n; @@ -18,7 +20,7 @@ function infiniteimprobabilitydrive_uninstall() Addon::unregisterHook('app_menu', 'addon/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php', 'infiniteimprobabilitydrive_app_menu'); } -function infiniteimprobabilitydrive_app_menu($a, &$b) +function infiniteimprobabilitydrive_app_menu(App $a, array &$b) { $b['app_menu'][] = ''; } diff --git a/irc/irc.php b/irc/irc.php index 6aeacbe6..f2d0c684 100644 --- a/irc/irc.php +++ b/irc/irc.php @@ -6,6 +6,8 @@ * Author: tony baldwin * Author: Tobias Diekershoff */ + +use Friendica\App; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -24,7 +26,7 @@ function irc_uninstall() { } -function irc_addon_settings(&$a,&$s) { +function irc_addon_settings(App $a, $s) { if(! local_user()) return; @@ -50,7 +52,7 @@ function irc_addon_settings(&$a,&$s) { } -function irc_addon_settings_post(&$a,&$b) { +function irc_addon_settings_post(App $a, $b) { if(! local_user()) return; diff --git a/jappixmini/jappixmini.php b/jappixmini/jappixmini.php index 372193fb..fcb49e42 100644 --- a/jappixmini/jappixmini.php +++ b/jappixmini/jappixmini.php @@ -419,7 +419,7 @@ function jappixmini_settings(App $a, &$s) "; } -function jappixmini_settings_post(App $a, &$b) +function jappixmini_settings_post(App $a, array &$b) { // save addon settings for a user if (!local_user()) { @@ -693,7 +693,7 @@ function jappixmini_cron(App $a, $d) } } -function jappixmini_download_source(App $a, &$b) +function jappixmini_download_source(App $a, array &$b) { // Jappix Mini source download link on About page $b .= '

Jappix Mini

'; diff --git a/js_upload/js_upload.php b/js_upload/js_upload.php index b1373ffc..6317bf48 100644 --- a/js_upload/js_upload.php +++ b/js_upload/js_upload.php @@ -14,6 +14,8 @@ * Module Author: Chris Case * */ + +use Friendica\App; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -34,7 +36,7 @@ function js_upload_uninstall() { } -function js_upload_form(&$a,&$b) { +function js_upload_form(App $a, $b) { $b['default_upload'] = false; @@ -134,7 +136,7 @@ EOT; } -function js_upload_post_init(&$a,&$b) { +function js_upload_post_init(App $a, $b) { // list of valid extensions, ex. array("jpeg", "xml", "bmp") @@ -162,7 +164,7 @@ function js_upload_post_init(&$a,&$b) { } -function js_upload_post_file(&$a,&$b) { +function js_upload_post_file(App $a, $b) { $result = $a->data['upload_result']; @@ -173,7 +175,7 @@ function js_upload_post_file(&$a,&$b) { } -function js_upload_post_end(&$a,&$b) { +function js_upload_post_end(App $a, $b) { logger('upload_post_end'); if(x($a->data,'upload_jsonresponse')) { diff --git a/krynn/krynn.php b/krynn/krynn.php index 47372926..34b3f762 100644 --- a/krynn/krynn.php +++ b/krynn/krynn.php @@ -9,6 +9,8 @@ * *"My body was my sacrifice... for my magic. This damage is permanent." - Raistlin Majere */ + +use Friendica\App; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; @@ -134,7 +136,7 @@ function krynn_settings_post($a,$post) { -function krynn_settings(&$a,&$s) { +function krynn_settings(App $a, $s) { if(! local_user()) return; diff --git a/langfilter/langfilter.php b/langfilter/langfilter.php index f22034e2..7d1963e6 100644 --- a/langfilter/langfilter.php +++ b/langfilter/langfilter.php @@ -70,7 +70,7 @@ function langfilter_addon_settings(App $a, &$s) * 3rd save the settings to the DB for later usage */ -function langfilter_addon_settings_post(App $a, &$b) +function langfilter_addon_settings_post(App $a, array &$b) { if (!local_user()) { return; @@ -112,8 +112,7 @@ function langfilter_addon_settings_post(App $a, &$b) * expand it again. */ -function langfilter_prepare_body_content_filter(App $a, &$hook_data) -{ +function langfilter_prepare_body_content_filter(App $a, &$hook_data) { $logged_user = local_user(); if (!$logged_user) { return; diff --git a/ldapauth/ldapauth.php b/ldapauth/ldapauth.php index 514fb1d1..7ed5e49d 100644 --- a/ldapauth/ldapauth.php +++ b/ldapauth/ldapauth.php @@ -53,6 +53,8 @@ * * ...etc. */ + +use Friencia\App; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Model\User; @@ -69,12 +71,12 @@ function ldapauth_uninstall() Addon::unregisterHook('authenticate', 'addon/ldapauth/ldapauth.php', 'ldapauth_hook_authenticate'); } -function ldapauth_load_config(\Friendica\App $a) +function ldapauth_load_config(App $a) { $a->loadConfigFile(__DIR__. '/config/ldapauth.ini.php'); } -function ldapauth_hook_authenticate($a, &$b) +function ldapauth_hook_authenticate(App $a, array &$b) { if (ldapauth_authenticate($b['username'], $b['password'])) { $results = get_existing_account($b['username']); diff --git a/libravatar/libravatar.php b/libravatar/libravatar.php index 14bc0358..7c3d25df 100644 --- a/libravatar/libravatar.php +++ b/libravatar/libravatar.php @@ -5,6 +5,8 @@ * Version: 1.1 * Author: Klaus Weidenbach */ + +use Friencia\App; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -40,7 +42,7 @@ function libravatar_load_config(\Friendica\App $a) * @param $a array * @param &$b array */ -function libravatar_lookup($a, &$b) +function libravatar_lookup(App $a, array &$b) { $default_avatar = Config::get('libravatar', 'default_avatar'); diff --git a/mailstream/mailstream.php b/mailstream/mailstream.php index 66b43303..1e3e2e47 100644 --- a/mailstream/mailstream.php +++ b/mailstream/mailstream.php @@ -6,6 +6,7 @@ * Author: Matthew Exon */ +use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\Config; @@ -71,7 +72,7 @@ function mailstream_uninstall() { function mailstream_module() {} -function mailstream_addon_admin(&$a,&$o) { +function mailstream_addon_admin(App $a, &$o) { $frommail = Config::get('mailstream', 'frommail'); $template = get_markup_template('admin.tpl', 'addon/mailstream/'); $config = ['frommail', @@ -83,13 +84,13 @@ function mailstream_addon_admin(&$a,&$o) { '$submit' => L10n::t('Save Settings')]); } -function mailstream_addon_admin_post ($a) { +function mailstream_addon_admin_post (App $a) { if (x($_POST, 'frommail')) { Config::set('mailstream', 'frommail', $_POST['frommail']); } } -function mailstream_generate_id($a, $uri) { +function mailstream_generate_id(App $a, $uri) { // http://www.jwz.org/doc/mid.html $host = $a->get_hostname(); $resource = hash('md5', $uri); @@ -98,56 +99,58 @@ function mailstream_generate_id($a, $uri) { return $message_id; } -function mailstream_post_hook(&$a, &$item) { +function mailstream_post_hook(App $a, array &$item) { if (!PConfig::get($item['uid'], 'mailstream', 'enabled')) { return; } - if (!$item['uid']) { + + if (!x($item, 'uid') || !x($item, 'contact-id') || !x($item, 'uri')) { return; } - if (!$item['contact-id']) { + + if (PConfig::get($item['uid'], 'mailstream', 'nolikes') && $item['verb'] == ACTIVITY_LIKE) { return; } - if (!$item['uri']) { - return; - } - if (PConfig::get($item['uid'], 'mailstream', 'nolikes')) { - if ($item['verb'] == ACTIVITY_LIKE) { - return; - } - } $message_id = mailstream_generate_id($a, $item['uri']); q("INSERT INTO `mailstream_item` (`uid`, `contact-id`, `uri`, `message-id`) " . "VALUES (%d, '%s', '%s', '%s')", intval($item['uid']), intval($item['contact-id']), dbesc($item['uri']), dbesc($message_id)); $r = q('SELECT * FROM `mailstream_item` WHERE `uid` = %d AND `contact-id` = %d AND `uri` = "%s"', intval($item['uid']), intval($item['contact-id']), dbesc($item['uri'])); - if (count($r) != 1) { + + if (!DBM::is_result($r)) { logger('mailstream_post_remote_hook: Unexpected number of items returned from mailstream_item', LOGGER_NORMAL); return; } + $ms_item = $r[0]; + logger('mailstream_post_remote_hook: created mailstream_item ' . $ms_item['id'] . ' for item ' . $item['uri'] . ' ' . $item['uid'] . ' ' . $item['contact-id'], LOGGER_DATA); + $user = mailstream_get_user($item['uid']); + if (!$user) { logger('mailstream_post_remote_hook: no user ' . $item['uid'], LOGGER_NORMAL); return; } + mailstream_send($a, $ms_item['message-id'], $item, $user); } function mailstream_get_user($uid) { $r = q('SELECT * FROM `user` WHERE `uid` = %d', intval($uid)); - if (count($r) != 1) { + + if (!DBM::is_result($r)) { logger('mailstream_post_remote_hook: Unexpected number of users returned', LOGGER_NORMAL); return; } + return $r[0]; } -function mailstream_do_images($a, &$item, &$attachments) { +function mailstream_do_images(App $a, array &$item, &$attachments) { if (!PConfig::get($item['uid'], 'mailstream', 'attachimg')) { return; } @@ -162,7 +165,9 @@ function mailstream_do_images($a, &$item, &$attachments) { 'data' => Network::fetchUrl($url, true, $redirects, 0, null, $cookiejar), 'guid' => hash("crc32", $url), 'filename' => basename($url), - 'type' => $a->get_curl_content_type()]; + 'type' => $a->get_curl_content_type() + ]; + if (strlen($attachments[$url]['data'])) { $item['body'] = str_replace($url, 'cid:' . $attachments[$url]['guid'], $item['body']); continue; @@ -171,43 +176,54 @@ function mailstream_do_images($a, &$item, &$attachments) { return $attachments; } -function mailstream_sender($item) { +function mailstream_sender(array $item) { $r = q('SELECT * FROM `contact` WHERE `id` = %d', $item['contact-id']); + if (DBM::is_result($r)) { - $contact = $r[0]; - if ($contact['name'] != $item['author-name']) { - return $contact['name'] . ' - ' . $item['author-name']; + if ($r[0]['name'] != $item['author-name']) { + return $r[0]['name'] . ' - ' . $item['author-name']; } } + return $item['author-name']; } function mailstream_decode_subject($subject) { $html = BBCode::convert($subject); + if (!$html) { return $subject; } + $notags = strip_tags($html); + if (!$notags) { return $subject; } + $noentity = html_entity_decode($notags); + if (!$noentity) { return $notags; } + $nocodes = preg_replace_callback("/(&#[0-9]+;)/", function($m) { return mb_convert_encoding($m[1], "UTF-8", "HTML-ENTITIES"); }, $noentity); + if (!$nocodes) { return $noentity; } + $trimmed = trim($nocodes); + if (!$trimmed) { return $nocodes; } + return $trimmed; } -function mailstream_subject($item) { - if ($item['title']) { +function mailstream_subject(array $item) { + if (x($item, 'title')) { return mailstream_decode_subject($item['title']); } $parent = $item['thr-parent']; @@ -250,8 +266,8 @@ function mailstream_subject($item) { return L10n::t("Friendica Item"); } -function mailstream_send($a, $message_id, $item, $user) { - if (!$item['visible']) { +function mailstream_send(App $a, $message_id, array $item, $user) { + if (!x($item, 'visible')) { return; } if (!$message_id) { @@ -350,7 +366,7 @@ function mailstream_cron($a, $b) { mailstream_tidy(); } -function mailstream_addon_settings(&$a,&$s) { +function mailstream_addon_settings(App $a, &$s) { $enabled = PConfig::get(local_user(), 'mailstream', 'enabled'); $address = PConfig::get(local_user(), 'mailstream', 'address'); $nolikes = PConfig::get(local_user(), 'mailstream', 'nolikes'); @@ -380,37 +396,43 @@ function mailstream_addon_settings(&$a,&$s) { '$submit' => L10n::t('Save Settings')]); } -function mailstream_addon_settings_post($a,$post) { +function mailstream_addon_settings_post(App $a, $post) { if ($_POST['mailstream_address'] != "") { PConfig::set(local_user(), 'mailstream', 'address', $_POST['mailstream_address']); - } - else { + } else { PConfig::delete(local_user(), 'mailstream', 'address'); } + if ($_POST['mailstream_nolikes']) { PConfig::set(local_user(), 'mailstream', 'nolikes', $_POST['mailstream_enabled']); - } - else { + } else { PConfig::delete(local_user(), 'mailstream', 'nolikes'); } + if ($_POST['mailstream_enabled']) { PConfig::set(local_user(), 'mailstream', 'enabled', $_POST['mailstream_enabled']); - } - else { + } else { PConfig::delete(local_user(), 'mailstream', 'enabled'); } + if ($_POST['mailstream_attachimg']) { PConfig::set(local_user(), 'mailstream', 'attachimg', $_POST['mailstream_attachimg']); - } - else { + } else { PConfig::delete(local_user(), 'mailstream', 'attachimg'); } } function mailstream_tidy() { $r = q("SELECT id FROM mailstream_item WHERE completed IS NOT NULL AND completed < DATE_SUB(NOW(), INTERVAL 1 YEAR)"); + + if (!DBM::is_result($r)) { + logger('Cannot load records from mailstream_item or none are returned.', LOGGER_DEBUG); + return; + } + foreach ($r as $rr) { q('DELETE FROM mailstream_item WHERE id = %d', intval($rr['id'])); } + logger('mailstream_tidy: deleted ' . count($r) . ' old items', LOGGER_DEBUG); } diff --git a/mathjax/mathjax.php b/mathjax/mathjax.php index c85068ea..30ace80e 100644 --- a/mathjax/mathjax.php +++ b/mathjax/mathjax.php @@ -6,6 +6,7 @@ * Author: Tobias Diekershoff * License: 3-clause BSD license */ + use Friendica\App; use Friendica\Core\Addon; use Friendica\Core\Config; @@ -73,7 +74,7 @@ function mathjax_settings (&$a, &$s) { /* we need to add one JavaScript include command to the html output * note that you have to check the jsmath/easy/load.js too. */ -function mathjax_page_header($a, &$b) { +function mathjax_page_header(App $a, array &$b) { // if the visitor of the page is not a local_user, use MathJax // otherwise check the users settings. $url = Config::get ('mathjax','baseurl'); diff --git a/membersince/membersince.php b/membersince/membersince.php index c11f9b53..5e935a8c 100644 --- a/membersince/membersince.php +++ b/membersince/membersince.php @@ -7,6 +7,7 @@ * Status: Unsupported */ +use Friencia\App; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Util\DateTimeFormat; @@ -16,13 +17,11 @@ function membersince_install() Addon::registerHook('profile_advanced', 'addon/membersince/membersince.php', 'membersince_display'); } -function membersince_uninstall() -{ +function membersince_uninstall() { Addon::unregisterHook('profile_advanced', 'addon/membersince/membersince.php', 'membersince_display'); } -function membersince_display(Friendica\App $a, &$b) -{ +function membersince_display(App $a, array &$b) { if ($a->getCurrentTheme() == 'frio') { // Works in Frio. $doc = new DOMDocument(); diff --git a/morepokes/morepokes.php b/morepokes/morepokes.php index e0caaa52..8b63bd1e 100644 --- a/morepokes/morepokes.php +++ b/morepokes/morepokes.php @@ -6,6 +6,8 @@ * Author: Thomas Willingham * */ + +use Friencia\App; use Friendica\Core\Addon; use Friendica\Core\L10n; @@ -19,7 +21,7 @@ function morepokes_uninstall() Addon::unregisterHook('poke_verbs', 'addon/morepokes/morepokes.php', 'morepokes_poke_verbs'); } -function morepokes_poke_verbs($a, &$b) +function morepokes_poke_verbs(App $a, array &$b) { $b['bitchslap'] = ['bitchslapped', L10n::t('bitchslap'), L10n::t('bitchslapped')]; $b['shag'] = ['shag', L10n::t('shag'), L10n::t('shagged')]; diff --git a/nsfw/nsfw.php b/nsfw/nsfw.php index 2ea20b4a..dd86f630 100644 --- a/nsfw/nsfw.php +++ b/nsfw/nsfw.php @@ -7,6 +7,8 @@ * Author: Mike Macgirvin * */ + +use Friencia\App; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; @@ -95,8 +97,7 @@ function nsfw_addon_settings(&$a, &$s) return; } -function nsfw_addon_settings_post(&$a, &$b) -{ +function nsfw_addon_settings_post(App $a, array &$b) { if (!local_user()) { return; } @@ -110,8 +111,7 @@ function nsfw_addon_settings_post(&$a, &$b) } } -function nsfw_prepare_body_content_filter(\Friendica\App $a, &$hook_data) -{ +function nsfw_prepare_body_content_filter(App $a, &$hook_data) { $words = null; if (PConfig::get(local_user(), 'nsfw', 'disable')) { return; diff --git a/openstreetmap/openstreetmap.php b/openstreetmap/openstreetmap.php index 26d51e1a..7ae356c2 100644 --- a/openstreetmap/openstreetmap.php +++ b/openstreetmap/openstreetmap.php @@ -8,6 +8,8 @@ * Author: Klaus Weidenbach * */ + +use Friencia\App; use Friendica\Core\Addon; use Friendica\Core\Cache; use Friendica\Core\Config; @@ -88,7 +90,7 @@ function openstreetmap_location($a, &$item) $nomserver = OSM_NOM; } - if ($item['coord'] != "") { + if (x($item, 'coord')) { $coords = explode(' ', $item['coord']); if (count($coords) > 1) { $lat = urlencode(round($coords[0], 5)); @@ -105,7 +107,7 @@ function openstreetmap_location($a, &$item) $target = $nomserver.'?q='.urlencode($item['location']); } - if ($item['location'] != "") { + if (x($item, 'location')) { $title = $item['location']; } else { $title = $item['coord']; @@ -114,7 +116,7 @@ function openstreetmap_location($a, &$item) $item['html'] = ''.$title.''; } -function openstreetmap_get_coordinates($a, &$b) +function openstreetmap_get_coordinates(App $a, array &$b) { $nomserver = Config::get('openstreetmap', 'nomserver', OSM_NOM); @@ -142,7 +144,7 @@ function openstreetmap_get_coordinates($a, &$b) } } -function openstreetmap_generate_named_map(&$a, &$b) +function openstreetmap_generate_named_map(App $a, array &$b) { openstreetmap_get_coordinates($a, $b); @@ -151,7 +153,7 @@ function openstreetmap_generate_named_map(&$a, &$b) } } -function openstreetmap_generate_map(&$a, &$b) +function openstreetmap_generate_map(App $a, array &$b) { $tmsserver = Config::get('openstreetmap', 'tmsserver', OSM_TMS); diff --git a/pageheader/pageheader.php b/pageheader/pageheader.php index eb121fb5..034f5cae 100644 --- a/pageheader/pageheader.php +++ b/pageheader/pageheader.php @@ -7,6 +7,8 @@ * Hauke Altmann * */ + +use Friendica\App; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -33,7 +35,7 @@ function pageheader_uninstall() { -function pageheader_addon_settings(&$a,&$s) { +function pageheader_addon_settings(App $a, $s) { if(! is_site_admin()) @@ -59,7 +61,7 @@ function pageheader_addon_settings(&$a,&$s) { } -function pageheader_addon_settings_post(&$a,&$b) { +function pageheader_addon_settings_post(App $a, $b) { if(! is_site_admin()) return; diff --git a/public_server/public_server.php b/public_server/public_server.php index a30d3303..b5cf6377 100644 --- a/public_server/public_server.php +++ b/public_server/public_server.php @@ -6,6 +6,7 @@ * Author: Keith Fernie */ +use Friencia\App; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -118,7 +119,7 @@ function public_server_cron($a, $b) logger("public_server: cron end"); } -function public_server_enotify(&$a, &$b) +function public_server_enotify(App $a, array &$b) { if (x($b, 'params') && $b['params']['type'] == NOTIFY_SYSTEM && x($b['params'], 'system_type') && $b['params']['system_type'] === 'public_server_expire') { diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index 191f8505..3886f720 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -6,6 +6,7 @@ * Author: Michael Vogel */ +use Friencia\App; use Friendica\Content\Text\BBCode; use Friendica\Content\Text\HTML; use Friendica\Core\Addon; @@ -375,12 +376,11 @@ function pumpio_settings_post(&$a, &$b) } } -function pumpio_load_config(\Friendica\App $a) { $a->loadConfigFile(__DIR__. '/config/pumpio.ini.php'); } -function pumpio_post_local(&$a, &$b) +function pumpio_post_local(App $a, array &$b) { if (!local_user() || (local_user() != $b['uid'])) { return; diff --git a/securemail/securemail.php b/securemail/securemail.php index 87941e79..649aca9d 100644 --- a/securemail/securemail.php +++ b/securemail/securemail.php @@ -53,7 +53,7 @@ function securemail_uninstall() { * * @see App */ -function securemail_settings(App &$a, &$s){ +function securemail_settings(App $a, &$s){ if (!local_user()) { return; } @@ -82,7 +82,7 @@ function securemail_settings(App &$a, &$s){ * * @see App */ -function securemail_settings_post(App &$a, array &$b){ +function securemail_settings_post(App $a, array &$b){ if (!local_user()) { return; @@ -147,7 +147,7 @@ function securemail_settings_post(App &$a, array &$b){ * * @see App */ -function securemail_emailer_send_prepare(App &$a, array &$b) { +function securemail_emailer_send_prepare(App $a, array &$b) { if (!x($b, 'uid')) { return; } diff --git a/smileybutton/smileybutton.php b/smileybutton/smileybutton.php index f613d290..16847438 100644 --- a/smileybutton/smileybutton.php +++ b/smileybutton/smileybutton.php @@ -5,6 +5,8 @@ * Version: 0.2 * Author: Johannes Schwab */ + +use Friencia\App; use Friendica\Core\Addon; function smileybutton_install() { @@ -24,15 +26,17 @@ function smileybutton_uninstall() { -function show_button(Friendica\App $a, &$b) { +function show_button(App $a, &$b) { // Disable if theme is quattro // TODO add style for quattro if ($a->getCurrentTheme() == 'quattro') return; + } // Disable for mobile because most mobiles have a smiley key for ther own - if ($a->is_mobile || $a->is_tablet) + if ($a->is_mobile || $a->is_tablet) { return; + } /** * diff --git a/smilies_adult/smilies_adult.php b/smilies_adult/smilies_adult.php index bb673f23..2a7dbebb 100644 --- a/smilies_adult/smilies_adult.php +++ b/smilies_adult/smilies_adult.php @@ -8,6 +8,8 @@ * This is a template for how to extend the "smily" code. * */ + +use Friendica\App; use Friendica\Core\Addon; function smilies_adult_install() { @@ -20,7 +22,7 @@ function smilies_adult_uninstall() { -function smilies_adult_smilies(&$a,&$b) { +function smilies_adult_smilies(App $a, $b) { $b['texts'][] = '(o)(o)'; $b['icons'][] = '' . '(o)(o)' . ''; diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index 9af2c6d1..d9d0f5b9 100644 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -94,7 +94,7 @@ function statusnet_check_item_notification(App $a, &$notification_data) $notification_data["profiles"][] = PConfig::get($notification_data["uid"], 'statusnet', 'own_url'); } -function statusnet_jot_nets(App $a, &$b) +function statusnet_jot_nets(App $a, array &$b) { if (!local_user()) { return; @@ -385,7 +385,7 @@ function statusnet_settings(App $a, &$s) $s .= '
'; } -function statusnet_post_local(App $a, &$b) +function statusnet_post_local(App $a, array &$b) { if ($b['edit']) { return; @@ -440,7 +440,7 @@ function statusnet_action(App $a, $uid, $pid, $action) logger("statusnet_action '" . $action . "' send, result: " . print_r($result, true), LOGGER_DEBUG); } -function statusnet_post_hook(App $a, &$b) +function statusnet_post_hook(App $a, array &$b) { /** * Post to GNU Social @@ -669,7 +669,7 @@ function statusnet_addon_admin(App $a, &$o) ]); } -function statusnet_prepare_body(App $a, &$b) +function statusnet_prepare_body(App $a, array &$b) { if ($b["item"]["network"] != NETWORK_STATUSNET) { return; diff --git a/testdrive/testdrive.php b/testdrive/testdrive.php index 8e71103f..25b19686 100644 --- a/testdrive/testdrive.php +++ b/testdrive/testdrive.php @@ -6,6 +6,7 @@ * Author: Mike Macgirvin */ +use Friencia\App; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -64,7 +65,7 @@ function testdrive_cron($a,$b) { $r = q("select * from user where account_expires_on < UTC_TIMESTAMP() + INTERVAL 5 DAY and expire_notification_sent = '0000-00-00 00:00:00' "); - if(count($r)) { + if (DBM::is_result($r)) { foreach($r as $rr) { notification([ 'uid' => $rr['uid'], @@ -87,14 +88,15 @@ function testdrive_cron($a,$b) { } $r = q("select * from user where account_expired = 1 and account_expires_on < UTC_TIMESTAMP() - INTERVAL 5 DAY "); - if(count($r)) { + + if (DBM::is_result($r)) { foreach($r as $rr) { User::remove($rr['uid']); } } } -function testdrive_enotify(&$a, &$b) { +function testdrive_enotify(App $a, array &$b) { if (x($b, 'params') && $b['params']['type'] == NOTIFY_SYSTEM && x($b['params'], 'system_type') && $b['params']['system_type'] === 'testdrive_expire') { $b['itemlink'] = $a->get_baseurl(); diff --git a/tumblr/tumblr.php b/tumblr/tumblr.php index 7ed91175..f86382e2 100644 --- a/tumblr/tumblr.php +++ b/tumblr/tumblr.php @@ -9,6 +9,7 @@ require_once __DIR__ . DIRECTORY_SEPARATOR . 'library' . DIRECTORY_SEPARATOR . 'tumblroauth.php'; +use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\Config; @@ -126,7 +127,7 @@ function tumblr_connect($a) { // Give an error message $o = 'Could not connect to Tumblr. Refresh the page or try again later.'; } - return($o); + return $o; } function tumblr_callback($a) { @@ -168,15 +169,17 @@ function tumblr_callback($a) { $o = L10n::t("You are now authenticated to tumblr."); $o .= '
'.L10n::t("return to the connector page").''; - return($o); + return $o; } -function tumblr_jot_nets(&$a,&$b) { - if(! local_user()) +function tumblr_jot_nets(App $a, $b) { + if (! local_user()) { return; + } - $tmbl_post = PConfig::get(local_user(),'tumblr','post'); - if(intval($tmbl_post) == 1) { + $tmbl_post = PConfig::get(local_user(), 'tumblr', 'post'); + + if (intval($tmbl_post) == 1) { $tmbl_defpost = PConfig::get(local_user(),'tumblr','post_by_default'); $selected = ((intval($tmbl_defpost) == 1) ? ' checked="checked" ' : ''); $b .= '
' @@ -185,10 +188,11 @@ function tumblr_jot_nets(&$a,&$b) { } -function tumblr_settings(&$a,&$s) { +function tumblr_settings(App $a, $s) { - if(! local_user()) + if (! local_user()) { return; + } /* Add our stylesheet to the page so we can make our settings look nice */ @@ -266,7 +270,7 @@ function tumblr_settings(&$a,&$s) { } -function tumblr_settings_post(&$a,&$b) { +function tumblr_settings_post(App $a, $b) { if(x($_POST,'tumblr-submit')) { @@ -278,7 +282,7 @@ function tumblr_settings_post(&$a,&$b) { } -function tumblr_post_local(&$a, &$b) { +function tumblr_post_local(App $a, array &$b) { // This can probably be changed to allow editing by pointing to a different API endpoint @@ -316,7 +320,7 @@ function tumblr_post_local(&$a, &$b) { -function tumblr_send(&$a,&$b) { +function tumblr_send(App $a, $b) { if($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) { return; diff --git a/twitter/twitter.php b/twitter/twitter.php index aa0adfb8..0338da40 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -190,7 +190,7 @@ function twitter_follow(App $a, &$contact) } } -function twitter_jot_nets(App $a, &$b) +function twitter_jot_nets(App $a, array &$b) { if (!local_user()) { return; @@ -386,7 +386,7 @@ function twitter_settings(App $a, &$s) $s .= '
'; } -function twitter_post_local(App $a, &$b) +function twitter_post_local(App $a, array &$b) { if ($b['edit']) { return; @@ -446,7 +446,7 @@ function twitter_action(App $a, $uid, $pid, $action) logger("twitter_action '" . $action . "' send, result: " . print_r($result, true), LOGGER_DEBUG); } -function twitter_post_hook(App $a, &$b) +function twitter_post_hook(App $a, array &$b) { // Post to Twitter if (!PConfig::get($b["uid"], 'twitter', 'import') @@ -761,7 +761,7 @@ function twitter_expire(App $a, $b) logger('twitter_expire: expire_end'); } -function twitter_prepare_body(App $a, &$b) +function twitter_prepare_body(App $a, array &$b) { if ($b["item"]["network"] != NETWORK_TWITTER) { return; @@ -920,7 +920,7 @@ function twitter_fetchtimeline(App $a, $uid) PConfig::set($uid, 'twitter', 'lastid', $lastid); } -function twitter_queue_hook(App $a, &$b) +function twitter_queue_hook(App $a, array &$b) { $qi = q("SELECT * FROM `queue` WHERE `network` = '%s'", dbesc(NETWORK_TWITTER) diff --git a/unicode_smilies/unicode_smilies.php b/unicode_smilies/unicode_smilies.php index faa553cc..db8d098d 100644 --- a/unicode_smilies/unicode_smilies.php +++ b/unicode_smilies/unicode_smilies.php @@ -5,6 +5,8 @@ * Version: 1.0 * Author: Michael Vogel */ + +use Friendica\App; use Friendica\Core\Addon; use Friendica\Content\Smilies; @@ -16,7 +18,7 @@ function unicode_smilies_uninstall() { Addon::unregisterHook('smilie', 'addon/unicode_smilies/unicode_smilies.php', 'unicode_smilies_smilies'); } -function unicode_smilies_smilies(&$a,&$b) { +function unicode_smilies_smilies(App $a, $b) { Smilies::add($b, ':-)', '😀'); Smilies::add($b, ':)', '😀'); Smilies::add($b, ':-(', '🙁'); diff --git a/viewsrc/viewsrc.php b/viewsrc/viewsrc.php index 9ffa0b8c..89c9b28e 100644 --- a/viewsrc/viewsrc.php +++ b/viewsrc/viewsrc.php @@ -6,6 +6,8 @@ * Author: Mike Macgirvin * */ + +use Friencia\App; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Model\Item; @@ -35,7 +37,7 @@ function viewsrc_page_end(&$a, &$o){ EOS; } -function viewsrc_item_photo_menu(&$a, &$b) +function viewsrc_item_photo_menu(App $a, array &$b) { if (!local_user()) { return; diff --git a/wppost/wppost.php b/wppost/wppost.php index 45b48993..0c023187 100644 --- a/wppost/wppost.php +++ b/wppost/wppost.php @@ -6,6 +6,7 @@ * Author: Mike Macgirvin */ +use Friencia\App; use Friendica\Content\Text\BBCode; use Friendica\Content\Text\HTML; use Friendica\Core\Addon; @@ -156,7 +157,7 @@ function wppost_settings_post(&$a,&$b) { } -function wppost_post_local(&$a, &$b) { +function wppost_post_local(App $a, array &$b) { // This can probably be changed to allow editing by pointing to a different API endpoint diff --git a/xmpp/xmpp.php b/xmpp/xmpp.php index bef31fed..eee4ea75 100644 --- a/xmpp/xmpp.php +++ b/xmpp/xmpp.php @@ -5,6 +5,7 @@ * Version: 0.1 * Author: Michael Vogel */ + use Friendica\App; use Friendica\Core\Addon; use Friendica\Core\Config;