diff --git a/advancedcontentfilter/advancedcontentfilter.php b/advancedcontentfilter/advancedcontentfilter.php index a00f2f07..3f036488 100644 --- a/advancedcontentfilter/advancedcontentfilter.php +++ b/advancedcontentfilter/advancedcontentfilter.php @@ -39,8 +39,6 @@ use Friendica\Content\Text\Markdown; use Friendica\Core\Addon; use Friendica\Core\Cache; use Friendica\Core\L10n; -use Friendica\Core\Logger; -use Friendica\Core\Renderer; use Friendica\Database\DBA; use Friendica\Database\DBStructure; use Friendica\Model\Item; @@ -66,7 +64,7 @@ function advancedcontentfilter_install() DBStructure::update(false, true); - Logger::log("installed advancedcontentfilter"); + logger("installed advancedcontentfilter"); } function advancedcontentfilter_uninstall() @@ -208,8 +206,8 @@ function advancedcontentfilter_content(App $a) return $html; } else { - $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/advancedcontentfilter/'); - return Renderer::replaceMacros($t, [ + $t = get_markup_template('settings.tpl', 'addon/advancedcontentfilter/'); + return replace_macros($t, [ '$messages' => [ 'backtosettings' => L10n::t('Back to Addon Settings'), 'title' => L10n::t('Advanced Content Filter'), diff --git a/blackout/blackout.php b/blackout/blackout.php index c0e0dc59..9b2d5b62 100644 --- a/blackout/blackout.php +++ b/blackout/blackout.php @@ -52,8 +52,6 @@ use Friendica\Core\Config; use Friendica\Core\Addon; use Friendica\Core\L10n; -use Friendica\Core\Logger; -use Friendica\Core\Renderer; function blackout_install() { Addon::registerHook('page_header', 'addon/blackout/blackout.php', 'blackout_redirect'); @@ -86,7 +84,7 @@ function blackout_redirect ($a, $b) { $date2 = 0; } if (( $date1 <= $now ) && ( $now <= $date2 )) { - Logger::log('redirecting user to blackout page'); + logger('redirecting user to blackout page'); System::externalRedirect($myurl); } } @@ -98,9 +96,9 @@ function blackout_addon_admin(&$a, &$o) { if (! is_string($myend)) { $myend = "YYYY-MM-DD:hhmm"; } $myurl = Config::get('blackout','url'); if (! is_string($myurl)) { $myurl = "http://www.example.com"; } - $t = Renderer::getMarkupTemplate( "admin.tpl", "addon/blackout/" ); + $t = get_markup_template( "admin.tpl", "addon/blackout/" ); - $o = Renderer::replaceMacros($t, [ + $o = replace_macros($t, [ '$submit' => L10n::t('Save Settings'), '$rurl' => ["rurl", "Redirect URL", $myurl, "all your visitors from the web will be redirected to this URL"], '$startdate' => ["startdate", "Begin of the Blackout
(YYYY-MM-DD hh:mm)", $mystart, "format is YYYY year, MM month, DD day, hh hour and mm minute"], diff --git a/blockem/blockem.php b/blockem/blockem.php index fbba29f4..2a5fd8b6 100644 --- a/blockem/blockem.php +++ b/blockem/blockem.php @@ -11,7 +11,6 @@ use Friendica\App; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; -use Friendica\Util\Strings; function blockem_install() { @@ -101,7 +100,7 @@ function blockem_enotify_store(App $a, array &$b) continue; } - if (Strings::compareLink($b['url'], $word)) { + if (link_compare($b['url'], $word)) { $found = true; break; } @@ -134,7 +133,7 @@ function blockem_prepare_body_content_filter(App $a, array &$hook_data) $found = false; foreach ($profiles_array as $word) { - if (Strings::compareLink($hook_data['item']['author-link'], trim($word))) { + if (link_compare($hook_data['item']['author-link'], trim($word))) { $found = true; break; } @@ -193,7 +192,7 @@ function blockem_item_photo_menu(App $a, array &$b) if (!empty($a->data['blockem'])) { foreach($a->data['blockem'] as $bloke) { - if (Strings::compareLink($bloke,$author)) { + if (link_compare($bloke,$author)) { $blocked = true; break; } @@ -232,7 +231,7 @@ function blockem_init(App $a) if (count($arr)) { foreach ($arr as $x) { - if (!Strings::compareLink(trim($x), trim($_GET['unblock']))) { + if (!link_compare(trim($x), trim($_GET['unblock']))) { $newarr[] = $x; } } diff --git a/blogger/blogger.php b/blogger/blogger.php index 496a47c8..00563c3a 100644 --- a/blogger/blogger.php +++ b/blogger/blogger.php @@ -10,10 +10,8 @@ use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\L10n; -use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Util\Network; -use Friendica\Util\XML; function blogger_install() { @@ -179,14 +177,14 @@ function blogger_send(App $a, array &$b) return; } - $bl_username = XML::escape(PConfig::get($b['uid'], 'blogger', 'bl_username')); - $bl_password = XML::escape(PConfig::get($b['uid'], 'blogger', 'bl_password')); + $bl_username = xmlify(PConfig::get($b['uid'], 'blogger', 'bl_username')); + $bl_password = xmlify(PConfig::get($b['uid'], 'blogger', 'bl_password')); $bl_blog = PConfig::get($b['uid'], 'blogger', 'bl_blog'); if ($bl_username && $bl_password && $bl_blog) { $title = '' . (($b['title']) ? $b['title'] : L10n::t('Post from Friendica')) . ''; $post = $title . BBCode::convert($b['body']); - $post = XML::escape($post); + $post = xmlify($post); $xml = <<< EOT @@ -204,12 +202,12 @@ function blogger_send(App $a, array &$b) EOT; - Logger::log('blogger: data: ' . $xml, Logger::DATA); + logger('blogger: data: ' . $xml, LOGGER_DATA); if ($bl_blog !== 'test') { $x = Network::post($bl_blog, $xml)->getBody(); } - Logger::log('posted to blogger: ' . (($x) ? $x : ''), Logger::DEBUG); + logger('posted to blogger: ' . (($x) ? $x : ''), LOGGER_DEBUG); } } diff --git a/buffer/buffer.php b/buffer/buffer.php index d9378cb1..048a27da 100644 --- a/buffer/buffer.php +++ b/buffer/buffer.php @@ -12,14 +12,11 @@ use Friendica\Content\Text\Plaintext; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; -use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Core\Protocol; -use Friendica\Core\Renderer; use Friendica\Database\DBA; use Friendica\Model\ItemContent; use Friendica\Util\Proxy as ProxyUtils; -use Friendica\Util\Strings; function buffer_install() { @@ -72,9 +69,9 @@ function buffer_content(App $a) function buffer_addon_admin(App $a, &$o) { - $t = Renderer::getMarkupTemplate("admin.tpl", "addon/buffer/"); + $t = get_markup_template("admin.tpl", "addon/buffer/"); - $o = Renderer::replaceMacros($t, [ + $o = replace_macros($t, [ '$submit' => L10n::t('Save Settings'), // name, label, value, help, [extra values] '$client_id' => ['client_id', L10n::t('Client ID'), Config::get('buffer', 'client_id'), ''], @@ -84,8 +81,8 @@ function buffer_addon_admin(App $a, &$o) function buffer_addon_admin_post(App $a) { - $client_id = ((!empty($_POST['client_id'])) ? Strings::escapeTags(trim($_POST['client_id'])) : ''); - $client_secret = ((!empty($_POST['client_secret'])) ? Strings::escapeTags(trim($_POST['client_secret'])) : ''); + $client_id = ((!empty($_POST['client_id'])) ? notags(trim($_POST['client_id'])) : ''); + $client_secret = ((!empty($_POST['client_secret'])) ? notags(trim($_POST['client_secret'])) : ''); Config::set('buffer', 'client_id' , $client_id); Config::set('buffer', 'client_secret', $client_secret); @@ -115,7 +112,7 @@ function buffer_connect(App $a) if (!$buffer->ok) { $o .= 'Connect to Buffer!'; } else { - Logger::log("buffer_connect: authenticated"); + logger("buffer_connect: authenticated"); $o .= L10n::t("You are now authenticated to buffer. "); $o .= '
' . L10n::t("return to the connector page") . ''; PConfig::set(local_user(), 'buffer','access_token', $buffer->access_token); @@ -301,7 +298,7 @@ function buffer_send(App $a, array &$b) $profiles = $buffer->go('/profiles'); if (is_array($profiles)) { - Logger::log("Will send these parameter ".print_r($b, true), Logger::DEBUG); + logger("Will send these parameter ".print_r($b, true), LOGGER_DEBUG); foreach ($profiles as $profile) { if (!$profile->default) @@ -360,7 +357,7 @@ function buffer_send(App $a, array &$b) } $post = ItemContent::getPlaintextPost($item, $limit, $includedlinks, $htmlmode); - Logger::log("buffer_send: converted message ".$b["id"]." result: ".print_r($post, true), Logger::DEBUG); + logger("buffer_send: converted message ".$b["id"]." result: ".print_r($post, true), LOGGER_DEBUG); // The image proxy is used as a sanitizer. Buffer seems to be really picky about pictures if (isset($post["image"])) { @@ -410,9 +407,9 @@ function buffer_send(App $a, array &$b) } //print_r($message); - Logger::log("buffer_send: data for message " . $b["id"] . ": " . print_r($message, true), Logger::DEBUG); + logger("buffer_send: data for message " . $b["id"] . ": " . print_r($message, true), LOGGER_DEBUG); $ret = $buffer->go('/updates/create', $message); - Logger::log("buffer_send: send message " . $b["id"] . " result: " . print_r($ret, true), Logger::DEBUG); + logger("buffer_send: send message " . $b["id"] . " result: " . print_r($ret, true), LOGGER_DEBUG); } } } diff --git a/catavatar/catavatar.php b/catavatar/catavatar.php index 77dd1812..b321ae33 100644 --- a/catavatar/catavatar.php +++ b/catavatar/catavatar.php @@ -10,9 +10,7 @@ use Friendica\App; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; -use Friendica\Core\Logger; use Friendica\Core\PConfig; -use Friendica\Core\Renderer; use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\Model\Contact; @@ -30,7 +28,7 @@ function catavatar_install() Addon::registerHook('addon_settings', 'addon/catavatar/catavatar.php', 'catavatar_addon_settings'); Addon::registerHook('addon_settings_post', 'addon/catavatar/catavatar.php', 'catavatar_addon_settings_post'); - Logger::log('registered catavatar'); + logger('registered catavatar'); } /** @@ -42,7 +40,7 @@ function catavatar_uninstall() Addon::unregisterHook('addon_settings', 'addon/catavatar/catavatar.php', 'catavatar_addon_settings'); Addon::unregisterHook('addon_settings_post', 'addon/catavatar/catavatar.php', 'catavatar_addon_settings_post'); - Logger::log('unregistered catavatar'); + logger('unregistered catavatar'); } /** @@ -54,8 +52,8 @@ function catavatar_addon_settings(App $a, &$s) return; } - $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/catavatar/'); - $s .= Renderer::replaceMacros($t, [ + $t = get_markup_template('settings.tpl', 'addon/catavatar/'); + $s .= replace_macros ($t, [ '$postpost' => !empty($_POST['catavatar-morecat']) || !empty($_POST['catavatar-emailcat']), '$uncache' => time(), '$uid' => local_user(), diff --git a/curweather/curweather.php b/curweather/curweather.php index 85fd4a60..db244c7d 100644 --- a/curweather/curweather.php +++ b/curweather/curweather.php @@ -17,7 +17,6 @@ use Friendica\Core\Cache; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\PConfig; -use Friendica\Core\Renderer; use Friendica\Util\Network; use Friendica\Util\Proxy as ProxyUtils; @@ -136,8 +135,8 @@ function curweather_network_mod_init(App $a, &$b) } if ($ok) { - $t = Renderer::getMarkupTemplate("widget.tpl", "addon/curweather/" ); - $curweather = Renderer::replaceMacros($t, [ + $t = get_markup_template("widget.tpl", "addon/curweather/" ); + $curweather = replace_macros ($t, [ '$title' => L10n::t("Current Weather"), '$icon' => ProxyUtils::proxifyUrl('http://openweathermap.org/img/w/'.$res['icon'].'.png'), '$city' => $res['city'], @@ -153,8 +152,8 @@ function curweather_network_mod_init(App $a, &$b) '$showonmap' => L10n::t('Show on map') ]); } else { - $t = Renderer::getMarkupTemplate('widget-error.tpl', 'addon/curweather/'); - $curweather = Renderer::replaceMacros( $t, [ + $t = get_markup_template('widget-error.tpl', 'addon/curweather/'); + $curweather = replace_macros( $t, [ '$problem' => L10n::t('There was a problem accessing the weather data. But have a look'), '$rpt' => $rpt, '$atOWM' => L10n::t('at OpenWeatherMap') @@ -198,9 +197,9 @@ function curweather_addon_settings(App $a, &$s) $enable_checked = (($enable) ? ' checked="checked" ' : ''); // load template and replace the macros - $t = Renderer::getMarkupTemplate("settings.tpl", "addon/curweather/" ); + $t = get_markup_template("settings.tpl", "addon/curweather/" ); - $s = Renderer::replaceMacros($t, [ + $s = replace_macros ($t, [ '$submit' => L10n::t('Save Settings'), '$header' => L10n::t('Current Weather').' '.L10n::t('Settings'), '$noappidtext' => $noappidtext, @@ -238,9 +237,9 @@ function curweather_addon_admin(App $a, &$o) $appid = Config::get('curweather', 'appid'); $cachetime = Config::get('curweather', 'cachetime'); - $t = Renderer::getMarkupTemplate("admin.tpl", "addon/curweather/" ); + $t = get_markup_template("admin.tpl", "addon/curweather/" ); - $o = Renderer::replaceMacros($t, [ + $o = replace_macros ($t, [ '$submit' => L10n::t('Save Settings'), '$cachetime' => [ 'cachetime', diff --git a/diaspora/diaspora.php b/diaspora/diaspora.php index 03793310..44bc1f74 100644 --- a/diaspora/diaspora.php +++ b/diaspora/diaspora.php @@ -13,7 +13,6 @@ use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\L10n; -use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Core\Protocol; use Friendica\Database\DBA; @@ -73,7 +72,7 @@ function diaspora_queue_hook(App $a, &$b) { continue; } - Logger::log('diaspora_queue: run'); + logger('diaspora_queue: run'); $r = q("SELECT `user`.* FROM `user` LEFT JOIN `contact` on `contact`.`uid` = `user`.`uid` WHERE `contact`.`self` = 1 AND `contact`.`id` = %d LIMIT 1", @@ -93,37 +92,37 @@ function diaspora_queue_hook(App $a, &$b) { $success = false; if ($handle && $password) { - Logger::log('diaspora_queue: able to post for user '.$handle); + logger('diaspora_queue: able to post for user '.$handle); $z = unserialize($x['content']); $post = $z['post']; - Logger::log('diaspora_queue: post: '.$post, Logger::DATA); + logger('diaspora_queue: post: '.$post, LOGGER_DATA); try { - Logger::log('diaspora_queue: prepare', Logger::DEBUG); + logger('diaspora_queue: prepare', LOGGER_DEBUG); $conn = new Diaspora_Connection($handle, $password); - Logger::log('diaspora_queue: try to log in '.$handle, Logger::DEBUG); + logger('diaspora_queue: try to log in '.$handle, LOGGER_DEBUG); $conn->logIn(); - Logger::log('diaspora_queue: try to send '.$body, Logger::DEBUG); + logger('diaspora_queue: try to send '.$body, LOGGER_DEBUG); $conn->provider = $hostname; $conn->postStatusMessage($post, $aspect); - Logger::log('diaspora_queue: send '.$userdata['uid'].' success', Logger::DEBUG); + logger('diaspora_queue: send '.$userdata['uid'].' success', LOGGER_DEBUG); $success = true; Queue::removeItem($x['id']); } catch (Exception $e) { - Logger::log("diaspora_queue: Send ".$userdata['uid']." failed: ".$e->getMessage(), Logger::DEBUG); + logger("diaspora_queue: Send ".$userdata['uid']." failed: ".$e->getMessage(), LOGGER_DEBUG); } } else { - Logger::log('diaspora_queue: send '.$userdata['uid'].' missing username or password', Logger::DEBUG); + logger('diaspora_queue: send '.$userdata['uid'].' missing username or password', LOGGER_DEBUG); } if (!$success) { - Logger::log('diaspora_queue: delayed'); + logger('diaspora_queue: delayed'); Queue::updateTime($x['id']); } } @@ -290,7 +289,7 @@ function diaspora_send(App $a, array &$b) { $hostname = $a->getHostName(); - Logger::log('diaspora_send: invoked'); + logger('diaspora_send: invoked'); if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) { return; @@ -312,14 +311,14 @@ function diaspora_send(App $a, array &$b) return; } - Logger::log('diaspora_send: prepare posting', Logger::DEBUG); + logger('diaspora_send: prepare posting', LOGGER_DEBUG); $handle = PConfig::get($b['uid'],'diaspora','handle'); $password = PConfig::get($b['uid'],'diaspora','password'); $aspect = PConfig::get($b['uid'],'diaspora','aspect'); if ($handle && $password) { - Logger::log('diaspora_send: all values seem to be okay', Logger::DEBUG); + logger('diaspora_send: all values seem to be okay', LOGGER_DEBUG); $tag_arr = []; $tags = ''; @@ -364,20 +363,20 @@ function diaspora_send(App $a, array &$b) require_once "addon/diaspora/diasphp.php"; try { - Logger::log('diaspora_send: prepare', Logger::DEBUG); + logger('diaspora_send: prepare', LOGGER_DEBUG); $conn = new Diaspora_Connection($handle, $password); - Logger::log('diaspora_send: try to log in '.$handle, Logger::DEBUG); + logger('diaspora_send: try to log in '.$handle, LOGGER_DEBUG); $conn->logIn(); - Logger::log('diaspora_send: try to send '.$body, Logger::DEBUG); + logger('diaspora_send: try to send '.$body, LOGGER_DEBUG); $conn->provider = $hostname; $conn->postStatusMessage($body, $aspect); - Logger::log('diaspora_send: success'); + logger('diaspora_send: success'); } catch (Exception $e) { - Logger::log("diaspora_send: Error submitting the post: " . $e->getMessage()); + logger("diaspora_send: Error submitting the post: " . $e->getMessage()); - Logger::log('diaspora_send: requeueing '.$b['uid'], Logger::DEBUG); + logger('diaspora_send: requeueing '.$b['uid'], LOGGER_DEBUG); $r = q("SELECT `id` FROM `contact` WHERE `uid` = %d AND `self`", $b['uid']); if (count($r)) diff --git a/dwpost/dwpost.php b/dwpost/dwpost.php index 28ae2d97..bc8959fc 100644 --- a/dwpost/dwpost.php +++ b/dwpost/dwpost.php @@ -12,12 +12,10 @@ use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\L10n; -use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Database\DBA; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; -use Friendica\Util\XML; function dwpost_install() { @@ -190,7 +188,7 @@ function dwpost_send(App $a, array &$b) if ($dw_username && $dw_password && $dw_blog) { $title = $b['title']; $post = BBCode::convert($b['body']); - $post = XML::escape($post); + $post = xmlify($post); $tags = dwpost_get_tags($b['tag']); $date = DateTimeFormat::convert($b['created'], $tz); @@ -227,13 +225,13 @@ function dwpost_send(App $a, array &$b) EOT; - Logger::log('dwpost: data: ' . $xml, Logger::DATA); + logger('dwpost: data: ' . $xml, LOGGER_DATA); if ($dw_blog !== 'test') { $x = Network::post($dw_blog, $xml, ["Content-Type: text/xml"])->getBody(); } - Logger::log('posted to dreamwidth: ' . ($x) ? $x : '', Logger::DEBUG); + logger('posted to dreamwidth: ' . ($x) ? $x : '', LOGGER_DEBUG); } } diff --git a/forumdirectory/forumdirectory.php b/forumdirectory/forumdirectory.php index a901015f..54818cdb 100644 --- a/forumdirectory/forumdirectory.php +++ b/forumdirectory/forumdirectory.php @@ -13,11 +13,9 @@ use Friendica\Content\Widget; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; -use Friendica\Core\Renderer; use Friendica\Database\DBA; use Friendica\Model\Contact; use Friendica\Model\Profile; -use Friendica\Util\Strings; use Friendica\Util\Temporal; require_once 'boot.php'; @@ -73,12 +71,12 @@ function forumdirectory_content(App $a) Nav::setSelected('directory'); if (!empty($a->data['search'])) { - $search = Strings::escapeTags(trim($a->data['search'])); + $search = notags(trim($a->data['search'])); } else { - $search = ((!empty($_GET['search'])) ? Strings::escapeTags(trim(rawurldecode($_GET['search']))) : ''); + $search = ((!empty($_GET['search'])) ? notags(trim(rawurldecode($_GET['search']))) : ''); } - $tpl = Renderer::getMarkupTemplate('directory_header.tpl'); + $tpl = get_markup_template('directory_header.tpl'); $globaldir = ''; $gdirpath = Config::get('system', 'directory'); @@ -89,7 +87,7 @@ function forumdirectory_content(App $a) $admin = ''; - $o .= Renderer::replaceMacros($tpl, [ + $o .= replace_macros($tpl, [ '$search' => $search, '$globaldir' => $globaldir, '$desc' => L10n::t('Find on this site'), @@ -189,9 +187,9 @@ function forumdirectory_content(App $a) $homepage = !empty($profile['homepage']) ? L10n::t('Homepage:') : false; $about = !empty($profile['about']) ? L10n::t('About:') : false; - $tpl = Renderer::getMarkupTemplate('forumdirectory_item.tpl', 'addon/forumdirectory/'); + $tpl = get_markup_template('forumdirectory_item.tpl', 'addon/forumdirectory/'); - $entry = Renderer::replaceMacros($tpl, [ + $entry = replace_macros($tpl, [ '$id' => $rr['id'], '$profile_link' => $profile_link, '$photo' => $rr[$photo], diff --git a/fromapp/fromapp.php b/fromapp/fromapp.php index f2b0f1fc..6a33cd03 100644 --- a/fromapp/fromapp.php +++ b/fromapp/fromapp.php @@ -8,7 +8,6 @@ */ use Friendica\Core\Addon; use Friendica\Core\L10n; -use Friendica\Core\Logger; use Friendica\Core\PConfig; function fromapp_install() @@ -16,7 +15,7 @@ function fromapp_install() Addon::registerHook('post_local', 'addon/fromapp/fromapp.php', 'fromapp_post_hook'); Addon::registerHook('addon_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings'); Addon::registerHook('addon_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post'); - Logger::log("installed fromapp"); + logger("installed fromapp"); } @@ -25,7 +24,7 @@ function fromapp_uninstall() Addon::unregisterHook('post_local', 'addon/fromapp/fromapp.php', 'fromapp_post_hook'); Addon::unregisterHook('addon_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings'); Addon::unregisterHook('addon_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post'); - Logger::log("removed fromapp"); + logger("removed fromapp"); } function fromapp_settings_post($a, $post) diff --git a/fromgplus/fromgplus.php b/fromgplus/fromgplus.php index 860438d8..9dc48753 100644 --- a/fromgplus/fromgplus.php +++ b/fromgplus/fromgplus.php @@ -12,10 +12,8 @@ define('FROMGPLUS_DEFAULT_POLL_INTERVAL', 30); // given in minutes use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; -use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Core\Protocol; -use Friendica\Core\Renderer; use Friendica\Object\Image; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; @@ -103,9 +101,9 @@ function fromgplus_addon_settings_post(&$a,&$b) { function fromgplus_addon_admin(&$a, &$o) { - $t = Renderer::getMarkupTemplate("admin.tpl", "addon/fromgplus/"); + $t = get_markup_template("admin.tpl", "addon/fromgplus/"); - $o = Renderer::replaceMacros($t, [ + $o = replace_macros($t, [ '$submit' => L10n::t('Save Settings'), '$key' => ['key', L10n::t('Key'), trim(Config::get('fromgplus', 'key')), ''], ]); @@ -128,25 +126,25 @@ function fromgplus_cron($a,$b) { if($last) { $next = $last + ($poll_interval * 60); if($next > time()) { - Logger::log('fromgplus: poll intervall not reached'); + logger('fromgplus: poll intervall not reached'); return; } } - Logger::log('fromgplus: cron_start'); + logger('fromgplus: cron_start'); $r = q("SELECT * FROM `pconfig` WHERE `cat` = 'fromgplus' AND `k` = 'enable' AND `v` = '1' ORDER BY RAND() "); if(count($r)) { foreach($r as $rr) { $account = PConfig::get($rr['uid'],'fromgplus','account'); if ($account) { - Logger::log('fromgplus: fetching for user '.$rr['uid']); + logger('fromgplus: fetching for user '.$rr['uid']); fromgplus_fetch($a, $rr['uid']); } } } - Logger::log('fromgplus: cron_end'); + logger('fromgplus: cron_end'); Config::set('fromgplus','last_poll', time()); } @@ -192,15 +190,15 @@ function fromgplus_post($a, $uid, $source, $body, $location, $coord, $id) { $_REQUEST['coord'] = $coord; if (($_REQUEST['title'] == "") && ($_REQUEST['body'] == "")) { - Logger::log('fromgplus: empty post for user '.$uid." ".print_r($_REQUEST, true)); + logger('fromgplus: empty post for user '.$uid." ".print_r($_REQUEST, true)); return; } require_once('mod/item.php'); //print_r($_REQUEST); - Logger::log('fromgplus: posting for user '.$uid." ".print_r($_REQUEST, true)); + logger('fromgplus: posting for user '.$uid." ".print_r($_REQUEST, true)); item_post($a); - Logger::log('fromgplus: done for user '.$uid); + logger('fromgplus: done for user '.$uid); } function fromgplus_html2bbcode($html) { @@ -474,7 +472,7 @@ function fromgplus_fetch($a, $uid) { // Don't publish items that are too young if (strtotime($item->published) > (time() - 3*60)) { - Logger::log('fromgplus_fetch: item too new '.$item->published); + logger('fromgplus_fetch: item too new '.$item->published); continue; } diff --git a/geocoordinates/geocoordinates.php b/geocoordinates/geocoordinates.php index 58c5a30c..89ccd883 100644 --- a/geocoordinates/geocoordinates.php +++ b/geocoordinates/geocoordinates.php @@ -9,10 +9,7 @@ use Friendica\Core\Addon; use Friendica\Core\Cache; use Friendica\Core\Config; use Friendica\Core\L10n; -use Friendica\Core\Logger; -use Friendica\Core\Renderer; use Friendica\Util\Network; -use Friendica\Util\Strings; function geocoordinates_install() { @@ -57,25 +54,25 @@ 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) { - Logger::log("API could not be queried", Logger::DEBUG); + logger("API could not be queried", LOGGER_DEBUG); return; } $data = json_decode($s); if ($data->status->code != "200") { - Logger::log("API returned error ".$data->status->code." ".$data->status->message, Logger::DEBUG); + logger("API returned error ".$data->status->code." ".$data->status->message, LOGGER_DEBUG); return; } if (($data->total_results == 0) || (count($data->results) == 0)) { - Logger::log("No results found for coordinates ".$item["coord"], Logger::DEBUG); + logger("No results found for coordinates ".$item["coord"], LOGGER_DEBUG); return; } $item["location"] = $data->results[0]->formatted; - Logger::log("Got location for coordinates ".$coords[0]."-".$coords[1].": ".$item["location"], Logger::DEBUG); + logger("Got location for coordinates ".$coords[0]."-".$coords[1].": ".$item["location"], LOGGER_DEBUG); if ($item["location"] != "") Cache::set("geocoordinates:".$language.":".$coords[0]."-".$coords[1], $item["location"]); @@ -89,9 +86,9 @@ function geocoordinates_post_hook($a, &$item) function geocoordinates_addon_admin(&$a, &$o) { - $t = Renderer::getMarkupTemplate("admin.tpl", "addon/geocoordinates/"); + $t = get_markup_template("admin.tpl", "addon/geocoordinates/"); - $o = Renderer::replaceMacros($t, [ + $o = replace_macros($t, [ '$submit' => L10n::t('Save Settings'), '$api_key' => ['api_key', L10n::t('API Key'), Config::get('geocoordinates', 'api_key'), ''], '$language' => ['language', L10n::t('Language code (IETF format)'), Config::get('geocoordinates', 'language'), ''], @@ -100,10 +97,10 @@ function geocoordinates_addon_admin(&$a, &$o) function geocoordinates_addon_admin_post(&$a) { - $api_key = ((x($_POST, 'api_key')) ? Strings::escapeTags(trim($_POST['api_key'])) : ''); + $api_key = ((x($_POST, 'api_key')) ? notags(trim($_POST['api_key'])) : ''); Config::set('geocoordinates', 'api_key', $api_key); - $language = ((x($_POST, 'language')) ? Strings::escapeTags(trim($_POST['language'])) : ''); + $language = ((x($_POST, 'language')) ? notags(trim($_POST['language'])) : ''); Config::set('geocoordinates', 'language', $language); info(L10n::t('Settings updated.'). EOL); } diff --git a/geonames/geonames.php b/geonames/geonames.php index 709e015b..dc6e116b 100644 --- a/geonames/geonames.php +++ b/geonames/geonames.php @@ -24,7 +24,6 @@ use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; -use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Util\Network; use Friendica\Util\XML; @@ -53,7 +52,7 @@ function geonames_install() { Addon::registerHook('addon_settings', 'addon/geonames/geonames.php', 'geonames_addon_admin'); Addon::registerHook('addon_settings_post', 'addon/geonames/geonames.php', 'geonames_addon_admin_post'); - Logger::log("installed geonames"); + logger("installed geonames"); } @@ -73,7 +72,7 @@ function geonames_uninstall() { Addon::unregisterHook('addon_settings_post', 'addon/geonames/geonames.php', 'geonames_addon_admin_post'); - Logger::log("removed geonames"); + logger("removed geonames"); } function geonames_load_config(\Friendica\App $a) @@ -92,7 +91,7 @@ function geonames_post_hook($a, &$item) { * */ - Logger::log('geonames invoked'); + logger('geonames invoked'); if(! local_user()) /* non-zero if this is a logged in user of this system */ return; @@ -133,7 +132,7 @@ function geonames_post_hook($a, &$item) { $item['location'] = $xml->geoname->name . ', ' . $xml->geoname->countryName; -// Logger::log('geonames : ' . print_r($xml,true), Logger::DATA); +// logger('geonames : ' . print_r($xml,true), LOGGER_DATA); return; } diff --git a/gnot/gnot.php b/gnot/gnot.php index 3cab8539..2c4555ba 100644 --- a/gnot/gnot.php +++ b/gnot/gnot.php @@ -9,7 +9,6 @@ */ use Friendica\Core\Addon; use Friendica\Core\L10n; -use Friendica\Core\Logger; use Friendica\Core\PConfig; function gnot_install() { @@ -18,7 +17,7 @@ function gnot_install() { Addon::registerHook('addon_settings_post', 'addon/gnot/gnot.php', 'gnot_settings_post'); Addon::registerHook('enotify_mail', 'addon/gnot/gnot.php', 'gnot_enotify_mail'); - Logger::log("installed gnot"); + logger("installed gnot"); } @@ -29,7 +28,7 @@ function gnot_uninstall() { Addon::unregisterHook('enotify_mail', 'addon/gnot/gnot.php', 'gnot_enotify_mail'); - Logger::log("removed gnot"); + logger("removed gnot"); } diff --git a/googlemaps/googlemaps.php b/googlemaps/googlemaps.php index f9aeefd8..e294c8e0 100644 --- a/googlemaps/googlemaps.php +++ b/googlemaps/googlemaps.php @@ -8,20 +8,19 @@ */ use Friendica\Core\Addon; use Friendica\Core\Cache; -use Friendica\Core\Logger; function googlemaps_install() { Addon::registerHook('render_location', 'addon/googlemaps/googlemaps.php', 'googlemaps_location'); - Logger::log("installed googlemaps"); + logger("installed googlemaps"); } function googlemaps_uninstall() { Addon::unregisterHook('render_location', 'addon/googlemaps/googlemaps.php', 'googlemaps_location'); - Logger::log("removed googlemaps"); + logger("removed googlemaps"); } function googlemaps_location($a, &$item) diff --git a/gravatar/gravatar.php b/gravatar/gravatar.php index 49eec4a6..9a23edfe 100644 --- a/gravatar/gravatar.php +++ b/gravatar/gravatar.php @@ -11,11 +11,8 @@ use Friendica\BaseModule; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; -use Friendica\Core\Logger; -use Friendica\Core\Renderer; use Friendica\Database\DBA; use Friendica\Util\Security; -use Friendica\Util\Strings; /** * Installs the addon hook @@ -24,7 +21,7 @@ function gravatar_install() { Addon::registerHook('load_config', 'addon/gravatar/gravatar.php', 'gravatar_load_config'); Addon::registerHook('avatar_lookup', 'addon/gravatar/gravatar.php', 'gravatar_lookup'); - Logger::log("registered gravatar in avatar_lookup hook"); + logger("registered gravatar in avatar_lookup hook"); } /** @@ -34,7 +31,7 @@ function gravatar_uninstall() { Addon::unregisterHook('load_config', 'addon/gravatar/gravatar.php', 'gravatar_load_config'); Addon::unregisterHook('avatar_lookup', 'addon/gravatar/gravatar.php', 'gravatar_lookup'); - Logger::log("unregistered gravatar in avatar_lookup hook"); + logger("unregistered gravatar in avatar_lookup hook"); } function gravatar_load_config(App $a) @@ -73,7 +70,7 @@ function gravatar_lookup($a, &$b) { * Display admin settings for this addon */ function gravatar_addon_admin (&$a, &$o) { - $t = Renderer::getMarkupTemplate( "admin.tpl", "addon/gravatar/" ); + $t = get_markup_template( "admin.tpl", "addon/gravatar/" ); $default_avatar = Config::get('gravatar', 'default_avatar'); $rating = Config::get('gravatar', 'rating'); @@ -109,7 +106,7 @@ function gravatar_addon_admin (&$a, &$o) { // output Gravatar settings $o .= ''; - $o .= Renderer::replaceMacros( $t, [ + $o .= replace_macros( $t, [ '$submit' => L10n::t('Save Settings'), '$default_avatar' => ['avatar', L10n::t('Default avatar image'), $default_avatar, L10n::t('Select default avatar image if none was found at Gravatar. See README'), $default_avatars], '$rating' => ['rating', L10n::t('Rating of images'), $rating, L10n::t('Select the appropriate avatar rating for your site. See README'), $ratings], @@ -122,8 +119,8 @@ function gravatar_addon_admin (&$a, &$o) { function gravatar_addon_admin_post (&$a) { BaseModule::checkFormSecurityToken('gravatarsave'); - $default_avatar = ((x($_POST, 'avatar')) ? Strings::escapeTags(trim($_POST['avatar'])) : 'identicon'); - $rating = ((x($_POST, 'rating')) ? Strings::escapeTags(trim($_POST['rating'])) : 'g'); + $default_avatar = ((x($_POST, 'avatar')) ? notags(trim($_POST['avatar'])) : 'identicon'); + $rating = ((x($_POST, 'rating')) ? notags(trim($_POST['rating'])) : 'g'); Config::set('gravatar', 'default_avatar', $default_avatar); Config::set('gravatar', 'rating', $rating); info(L10n::t('Gravatar settings updated.') .EOL); diff --git a/group_text/group_text.php b/group_text/group_text.php index 76bb03fd..3f91ff35 100644 --- a/group_text/group_text.php +++ b/group_text/group_text.php @@ -7,7 +7,6 @@ */ use Friendica\Core\Addon; use Friendica\Core\L10n; -use Friendica\Core\Logger; use Friendica\Core\PConfig; function group_text_install() { @@ -15,7 +14,7 @@ function group_text_install() { Addon::registerHook('addon_settings', 'addon/group_text/group_text.php', 'group_text_settings'); Addon::registerHook('addon_settings_post', 'addon/group_text/group_text.php', 'group_text_settings_post'); - Logger::log("installed group_text"); + logger("installed group_text"); } @@ -25,7 +24,7 @@ function group_text_uninstall() { Addon::unregisterHook('addon_settings_post', 'addon/group_text/group_text.php', 'group_text_settings_post'); - Logger::log("removed group_text"); + logger("removed group_text"); } diff --git a/ifttt/ifttt.php b/ifttt/ifttt.php index fd570048..2e48319a 100644 --- a/ifttt/ifttt.php +++ b/ifttt/ifttt.php @@ -13,12 +13,10 @@ require_once 'include/text.php'; use Friendica\App; use Friendica\Core\Addon; use Friendica\Core\L10n; -use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Core\Protocol; use Friendica\Database\DBA; use Friendica\Model\Item; -use Friendica\Util\Strings; function ifttt_install() { @@ -51,7 +49,7 @@ function ifttt_settings(App $a, &$s) $key = PConfig::get(local_user(), 'ifttt', 'key'); if (!$key) { - $key = Strings::getRandomHex(20); + $key = random_string(20); PConfig::set(local_user(), 'ifttt', 'key', $key); } @@ -105,16 +103,16 @@ function ifttt_post(App $a) $user = DBA::selectFirst('user', ['uid'], ['nickname' => $nickname]); if (!DBA::isResult($user)) { - Logger::log('User ' . $nickname . ' not found.', Logger::DEBUG); + logger('User ' . $nickname . ' not found.', LOGGER_DEBUG); return; } $uid = $user['uid']; - Logger::log('Received a post for user ' . $uid . ' from ifttt ' . print_r($_REQUEST, true), Logger::DEBUG); + logger('Received a post for user ' . $uid . ' from ifttt ' . print_r($_REQUEST, true), LOGGER_DEBUG); if (!isset($_REQUEST['key'])) { - Logger::log('No key found.'); + logger('No key found.'); return; } @@ -122,7 +120,7 @@ function ifttt_post(App $a) // Check the key if ($key != PConfig::get($uid, 'ifttt', 'key')) { - Logger::log('Invalid key for user ' . $uid, Logger::DEBUG); + logger('Invalid key for user ' . $uid, LOGGER_DEBUG); return; } @@ -133,7 +131,7 @@ function ifttt_post(App $a) } if (!in_array($item['type'], ['status', 'link', 'photo'])) { - Logger::log('Unknown item type ' . $item['type'], Logger::DEBUG); + logger('Unknown item type ' . $item['type'], LOGGER_DEBUG); return; } diff --git a/ijpost/ijpost.php b/ijpost/ijpost.php index d2a3071e..3dcfb31f 100644 --- a/ijpost/ijpost.php +++ b/ijpost/ijpost.php @@ -11,11 +11,9 @@ use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\L10n; -use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; -use Friendica\Util\XML; function ijpost_install() { @@ -186,7 +184,7 @@ function ijpost_send(&$a, &$b) if ($ij_username && $ij_password && $ij_blog) { $title = $b['title']; $post = BBCode::convert($b['body']); - $post = XML::escape($post); + $post = xmlify($post); $tags = ijpost_get_tags($b['tag']); $date = DateTimeFormat::convert($b['created'], $tz); @@ -223,12 +221,12 @@ function ijpost_send(&$a, &$b) EOT; - Logger::log('ijpost: data: ' . $xml, Logger::DATA); + logger('ijpost: data: ' . $xml, LOGGER_DATA); if ($ij_blog !== 'test') { $x = Network::post($ij_blog, $xml, ["Content-Type: text/xml"])->getBody(); } - Logger::log('posted to insanejournal: ' . $x ? $x : '', Logger::DEBUG); + logger('posted to insanejournal: ' . $x ? $x : '', LOGGER_DEBUG); } } diff --git a/impressum/impressum.php b/impressum/impressum.php index 3e04c64f..90775116 100644 --- a/impressum/impressum.php +++ b/impressum/impressum.php @@ -11,23 +11,20 @@ use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; -use Friendica\Core\Logger; -use Friendica\Core\Renderer; use Friendica\Util\Proxy as ProxyUtils; -use Friendica\Util\Strings; function impressum_install() { Addon::registerHook('load_config', 'addon/impressum/impressum.php', 'impressum_load_config'); Addon::registerHook('about_hook', 'addon/impressum/impressum.php', 'impressum_show'); Addon::registerHook('page_end', 'addon/impressum/impressum.php', 'impressum_footer'); - Logger::log("installed impressum Addon"); + logger("installed impressum Addon"); } function impressum_uninstall() { Addon::unregisterHook('load_config', 'addon/impressum/impressum.php', 'impressum_load_config'); Addon::unregisterHook('about_hook', 'addon/impressum/impressum.php', 'impressum_show'); Addon::unregisterHook('page_end', 'addon/impressum/impressum.php', 'impressum_footer'); - Logger::log("uninstalled impressum Addon"); + logger("uninstalled impressum Addon"); } function impressum_module() { @@ -87,11 +84,11 @@ function impressum_show($a,&$b) { } function impressum_addon_admin_post (&$a) { - $owner = ((x($_POST, 'owner')) ? Strings::escapeTags(trim($_POST['owner'])) : ''); - $ownerprofile = ((x($_POST, 'ownerprofile')) ? Strings::escapeTags(trim($_POST['ownerprofile'])) : ''); + $owner = ((x($_POST, 'owner')) ? notags(trim($_POST['owner'])) : ''); + $ownerprofile = ((x($_POST, 'ownerprofile')) ? notags(trim($_POST['ownerprofile'])) : ''); $postal = ((x($_POST, 'postal')) ? (trim($_POST['postal'])) : ''); $notes = ((x($_POST, 'notes')) ? (trim($_POST['notes'])) : ''); - $email = ((x($_POST, 'email')) ? Strings::escapeTags(trim($_POST['email'])) : ''); + $email = ((x($_POST, 'email')) ? notags(trim($_POST['email'])) : ''); $footer_text = ((x($_POST, 'footer_text')) ? (trim($_POST['footer_text'])) : ''); Config::set('impressum','owner',strip_tags($owner)); Config::set('impressum','ownerprofile',strip_tags($ownerprofile)); @@ -102,8 +99,8 @@ function impressum_addon_admin_post (&$a) { info(L10n::t('Settings updated.'). EOL ); } function impressum_addon_admin (&$a, &$o) { - $t = Renderer::getMarkupTemplate( "admin.tpl", "addon/impressum/" ); - $o = Renderer::replaceMacros($t, [ + $t = get_markup_template( "admin.tpl", "addon/impressum/" ); + $o = replace_macros($t, [ '$submit' => L10n::t('Save Settings'), '$owner' => ['owner', L10n::t('Site Owner'), Config::get('impressum','owner'), L10n::t('The page operators name.')], '$ownerprofile' => ['ownerprofile', L10n::t('Site Owners Profile'), Config::get('impressum','ownerprofile'), L10n::t('Profile address of the operator.')], diff --git a/irc/irc.php b/irc/irc.php index 4804fb6f..38ce5f24 100644 --- a/irc/irc.php +++ b/irc/irc.php @@ -10,7 +10,6 @@ use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\PConfig; -use Friendica\Core\Renderer; function irc_install() { Addon::registerHook('app_menu', 'addon/irc/irc.php', 'irc_app_menu'); @@ -37,8 +36,8 @@ function irc_addon_settings(&$a,&$s) { $sitechats = PConfig::get( local_user(), 'irc','sitechats'); /* popular channels */ $autochans = PConfig::get( local_user(), 'irc','autochans'); /* auto connect chans */ - $t = Renderer::getMarkupTemplate( "settings.tpl", "addon/irc/" ); - $s .= Renderer::replaceMacros($t, [ + $t = get_markup_template( "settings.tpl", "addon/irc/" ); + $s .= replace_macros($t, [ '$header' => L10n::t('IRC Settings'), '$info' => L10n::t('Here you can change the system wide settings for the channels to automatically join and access via the side bar. Note the changes you do here, only effect the channel selection if you are logged in.'), '$submit' => L10n::t('Save Settings'), @@ -136,8 +135,8 @@ function irc_addon_admin_post (&$a) { function irc_addon_admin (&$a, &$o) { $sitechats = Config::get('irc','sitechats'); /* popular channels */ $autochans = Config::get('irc','autochans'); /* auto connect chans */ - $t = Renderer::getMarkupTemplate( "admin.tpl", "addon/irc/" ); - $o = Renderer::replaceMacros($t, [ + $t = get_markup_template( "admin.tpl", "addon/irc/" ); + $o = replace_macros($t, [ '$submit' => L10n::t('Save Settings'), '$autochans' => [ 'autochans', L10n::t('Channel(s) to auto connect (comma separated)'), $autochans, L10n::t('List of channels that shall automatically connected to when the app is launched.')], '$sitechats' => [ 'sitechats', L10n::t('Popular Channels (comma separated)'), $sitechats, L10n::t('List of popular channels, will be displayed at the side and hotlinked for easy joining.') ] diff --git a/jappixmini/jappixmini.php b/jappixmini/jappixmini.php index e2ef01d2..8111f9fd 100644 --- a/jappixmini/jappixmini.php +++ b/jappixmini/jappixmini.php @@ -66,7 +66,6 @@ use Friendica\App; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; -use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Core\Protocol; use Friendica\Database\DBA; @@ -585,7 +584,7 @@ function jappixmini_cron(App $a, $d) // go through list of users with jabber enabled $users = q("SELECT `uid` FROM `pconfig` WHERE `cat`='jappixmini' AND (`k`='autosubscribe' OR `k`='autoapprove') AND `v`='1'"); - Logger::log("jappixmini: Update list of contacts' jabber accounts for " . count($users) . " users."); + logger("jappixmini: Update list of contacts' jabber accounts for " . count($users) . " users."); if (!count($users)) { return; diff --git a/js_upload/js_upload.php b/js_upload/js_upload.php index d4f0ec1e..adeba838 100644 --- a/js_upload/js_upload.php +++ b/js_upload/js_upload.php @@ -17,7 +17,6 @@ use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; -use Friendica\Core\Logger; function js_upload_install() { Addon::registerHook('photo_upload_form', 'addon/js_upload/js_upload.php', 'js_upload_form'); @@ -160,7 +159,7 @@ function js_upload_post_init(&$a,&$b) { $a->data['upload_jsonresponse'] = htmlspecialchars(json_encode($result), ENT_NOQUOTES); if(isset($result['error'])) { - Logger::log('mod/photos.php: photos_post(): error uploading photo: ' . $result['error'] , Logger::DEBUG); + logger('mod/photos.php: photos_post(): error uploading photo: ' . $result['error'] , 'LOGGER_DEBUG'); echo json_encode($result); killme(); } @@ -182,7 +181,7 @@ function js_upload_post_file(&$a,&$b) { function js_upload_post_end(&$a,&$b) { -Logger::log('upload_post_end'); +logger('upload_post_end'); if(x($a->data,'upload_jsonresponse')) { echo $a->data['upload_jsonresponse']; killme(); diff --git a/krynn/krynn.php b/krynn/krynn.php index 97871c3a..4b6e1f7f 100644 --- a/krynn/krynn.php +++ b/krynn/krynn.php @@ -11,7 +11,6 @@ */ use Friendica\Core\Addon; use Friendica\Core\L10n; -use Friendica\Core\Logger; use Friendica\Core\PConfig; function krynn_install() { @@ -36,7 +35,7 @@ function krynn_install() { Addon::registerHook('addon_settings', 'addon/krynn/krynn.php', 'krynn_settings'); Addon::registerHook('addon_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post'); - Logger::log("installed krynn"); + logger("installed krynn"); } @@ -55,7 +54,7 @@ function krynn_uninstall() { Addon::unregisterHook('addon_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post'); - Logger::log("removed krynn"); + logger("removed krynn"); } @@ -71,7 +70,7 @@ function krynn_post_hook($a, &$item) { * */ - Logger::log('krynn invoked'); + logger('krynn invoked'); if(! local_user()) /* non-zero if this is a logged in user of this system */ return; diff --git a/langfilter/langfilter.php b/langfilter/langfilter.php index 8cc8f697..6922ac82 100644 --- a/langfilter/langfilter.php +++ b/langfilter/langfilter.php @@ -12,7 +12,6 @@ use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; -use Friendica\Core\Renderer; /* Define the hooks we want to use * that is, we have settings, we need to save the settings and we want @@ -51,8 +50,8 @@ function langfilter_addon_settings(App $a, &$s) $minconfidence = PConfig::get(local_user(), 'langfilter', 'minconfidence') * 100; $minlength = PConfig::get(local_user(), 'langfilter', 'minlength'); - $t = Renderer::getMarkupTemplate("settings.tpl", "addon/langfilter/"); - $s .= Renderer::replaceMacros($t, [ + $t = get_markup_template("settings.tpl", "addon/langfilter/"); + $s .= replace_macros($t, [ '$title' => L10n::t("Language Filter"), '$intro' => L10n::t('This addon tries to identify the language posts are writen in. If it does not match any language specifed below, posts will be hidden by collapsing them.'), '$enabled' => ['langfilter_enable', L10n::t('Use the language filter'), $enable_checked, ''], diff --git a/ldapauth/ldapauth.php b/ldapauth/ldapauth.php index eb8cafc4..514fb1d1 100644 --- a/ldapauth/ldapauth.php +++ b/ldapauth/ldapauth.php @@ -55,7 +55,6 @@ */ use Friendica\Core\Addon; use Friendica\Core\Config; -use Friendica\Core\Logger; use Friendica\Model\User; function ldapauth_install() @@ -100,28 +99,28 @@ function ldapauth_authenticate($username, $password) $ldap_autocreateaccount_nameattribute = Config::get('ldapauth', 'ldap_autocreateaccount_nameattribute'); if (!(strlen($password) && function_exists('ldap_connect') && strlen($ldap_server))) { - Logger::log("ldapauth: not configured or missing php-ldap module"); + logger("ldapauth: not configured or missing php-ldap module"); return false; } $connect = @ldap_connect($ldap_server); if ($connect === false) { - Logger::log("ldapauth: could not connect to $ldap_server"); + logger("ldapauth: could not connect to $ldap_server"); return false; } @ldap_set_option($connect, LDAP_OPT_PROTOCOL_VERSION, 3); @ldap_set_option($connect, LDAP_OPT_REFERRALS, 0); if ((@ldap_bind($connect, $ldap_binddn, $ldap_bindpw)) === false) { - Logger::log("ldapauth: could not bind $ldap_server as $ldap_binddn"); + logger("ldapauth: could not bind $ldap_server as $ldap_binddn"); return false; } $res = @ldap_search($connect, $ldap_searchdn, $ldap_userattr . '=' . $username); if (!$res) { - Logger::log("ldapauth: $ldap_userattr=$username,$ldap_searchdn not found"); + logger("ldapauth: $ldap_userattr=$username,$ldap_searchdn not found"); return false; } @@ -162,13 +161,13 @@ function ldapauth_authenticate($username, $password) @ldap_close($connect); if ($eno === 32) { - Logger::log("ldapauth: access control group Does Not Exist"); + logger("ldapauth: access control group Does Not Exist"); return false; } elseif ($eno === 16) { - Logger::log('ldapauth: membership attribute does not exist in access control group'); + logger('ldapauth: membership attribute does not exist in access control group'); return false; } else { - Logger::log('ldapauth: error: ' . $err); + logger('ldapauth: error: ' . $err); return false; } } elseif ($r === false) { @@ -190,12 +189,12 @@ function ldap_autocreateaccount($ldap_autocreateaccount, $username, $password, $ try { User::create($arr); - Logger::log("ldapauth: account " . $username . " created"); + logger("ldapauth: account " . $username . " created"); } catch (Exception $ex) { - Logger::log("ldapauth: account " . $username . " was not created ! : " . $ex->getMessage()); + logger("ldapauth: account " . $username . " was not created ! : " . $ex->getMessage()); } } else { - Logger::log("ldapauth: unable to create account, no email or nickname found"); + logger("ldapauth: unable to create account, no email or nickname found"); } } } diff --git a/leistungsschutzrecht/leistungsschutzrecht.php b/leistungsschutzrecht/leistungsschutzrecht.php index 020c3af3..c0625ccb 100644 --- a/leistungsschutzrecht/leistungsschutzrecht.php +++ b/leistungsschutzrecht/leistungsschutzrecht.php @@ -7,7 +7,6 @@ */ use Friendica\Core\Addon; use Friendica\Core\Config; -use Friendica\Core\Logger; use Friendica\Util\Network; function leistungsschutzrecht_install() { @@ -164,7 +163,7 @@ function leistungsschutzrecht_cron($a,$b) { if($last) { $next = $last + 86400; if($next > time()) { - Logger::log('poll intervall not reached'); + logger('poll intervall not reached'); return; } } diff --git a/libertree/libertree.php b/libertree/libertree.php index 0804476c..19512bc5 100644 --- a/libertree/libertree.php +++ b/libertree/libertree.php @@ -9,7 +9,6 @@ use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\L10n; -use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Database\DBA; use Friendica\Util\Network; @@ -158,7 +157,7 @@ function libertree_post_local(&$a,&$b) { function libertree_send(&$a,&$b) { - Logger::log('libertree_send: invoked'); + logger('libertree_send: invoked'); if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) { return; @@ -233,6 +232,6 @@ function libertree_send(&$a,&$b) { ]; $result = Network::post($ltree_blog, $params)->getBody(); - Logger::log('libertree: ' . $result); + logger('libertree: ' . $result); } } diff --git a/libravatar/libravatar.php b/libravatar/libravatar.php index c711bf5e..bc671548 100644 --- a/libravatar/libravatar.php +++ b/libravatar/libravatar.php @@ -11,11 +11,8 @@ use Friendica\BaseModule; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; -use Friendica\Core\Logger; -use Friendica\Core\Renderer; use Friendica\Database\DBA; use Friendica\Util\Security; -use Friendica\Util\Strings; /** * Installs the addon hook @@ -24,7 +21,7 @@ function libravatar_install() { Addon::registerHook('load_config', 'addon/libravatar/libravatar.php', 'libravatar_load_config'); Addon::registerHook('avatar_lookup', 'addon/libravatar/libravatar.php', 'libravatar_lookup'); - Logger::log("registered libravatar in avatar_lookup hook"); + logger("registered libravatar in avatar_lookup hook"); } /** @@ -34,7 +31,7 @@ function libravatar_uninstall() { Addon::unregisterHook('load_config', 'addon/libravatar/libravatar.php', 'libravatar_load_config'); Addon::unregisterHook('avatar_lookup', 'addon/libravatar/libravatar.php', 'libravatar_lookup'); - Logger::log("unregistered libravatar in avatar_lookup hook"); + logger("unregistered libravatar in avatar_lookup hook"); } function libravatar_load_config(App $a) @@ -76,7 +73,7 @@ function libravatar_lookup($a, &$b) */ function libravatar_addon_admin(&$a, &$o) { - $t = Renderer::getMarkupTemplate("admin.tpl", "addon/libravatar"); + $t = get_markup_template("admin.tpl", "addon/libravatar"); $default_avatar = Config::get('libravatar', 'default_avatar'); @@ -112,7 +109,7 @@ function libravatar_addon_admin(&$a, &$o) // output Libravatar settings $o .= ''; - $o .= Renderer::replaceMacros( $t, [ + $o .= replace_macros( $t, [ '$submit' => L10n::t('Save Settings'), '$default_avatar' => ['avatar', L10n::t('Default avatar image'), $default_avatar, L10n::t('Select default avatar image if none was found. See README'), $default_avatars], ]); @@ -125,7 +122,7 @@ function libravatar_addon_admin_post(&$a) { BaseModule::checkFormSecurityToken('libravatarrsave'); - $default_avatar = ((x($_POST, 'avatar')) ? Strings::escapeTags(trim($_POST['avatar'])) : 'identicon'); + $default_avatar = ((x($_POST, 'avatar')) ? notags(trim($_POST['avatar'])) : 'identicon'); Config::set('libravatar', 'default_avatar', $default_avatar); info(L10n::t('Libravatar settings updated.') .EOL); } diff --git a/ljpost/ljpost.php b/ljpost/ljpost.php index c60af03c..dfc1387b 100644 --- a/ljpost/ljpost.php +++ b/ljpost/ljpost.php @@ -11,11 +11,9 @@ use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\L10n; -use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; -use Friendica\Util\XML; function ljpost_install() { Addon::registerHook('post_local', 'addon/ljpost/ljpost.php', 'ljpost_post_local'); @@ -170,20 +168,20 @@ function ljpost_send(&$a,&$b) { if($x && strlen($x[0]['timezone'])) $tz = $x[0]['timezone']; - $lj_username = XML::escape(PConfig::get($b['uid'],'ljpost','lj_username')); - $lj_password = XML::escape(PConfig::get($b['uid'],'ljpost','lj_password')); - $lj_journal = XML::escape(PConfig::get($b['uid'],'ljpost','lj_journal')); + $lj_username = xmlify(PConfig::get($b['uid'],'ljpost','lj_username')); + $lj_password = xmlify(PConfig::get($b['uid'],'ljpost','lj_password')); + $lj_journal = xmlify(PConfig::get($b['uid'],'ljpost','lj_journal')); // if(! $lj_journal) // $lj_journal = $lj_username; - $lj_blog = XML::escape(PConfig::get($b['uid'],'ljpost','lj_blog')); + $lj_blog = xmlify(PConfig::get($b['uid'],'ljpost','lj_blog')); if(! strlen($lj_blog)) - $lj_blog = XML::escape('http://www.livejournal.com/interface/xmlrpc'); + $lj_blog = xmlify('http://www.livejournal.com/interface/xmlrpc'); if($lj_username && $lj_password && $lj_blog) { - $title = XML::escape($b['title']); + $title = xmlify($b['title']); $post = BBCode::convert($b['body']); - $post = XML::escape($post); + $post = xmlify($post); $tags = ljpost_get_tags($b['tag']); $date = DateTimeFormat::convert($b['created'], $tz); @@ -233,12 +231,12 @@ function ljpost_send(&$a,&$b) { EOT; - Logger::log('ljpost: data: ' . $xml, Logger::DATA); + logger('ljpost: data: ' . $xml, LOGGER_DATA); if ($lj_blog !== 'test') { $x = Network::post($lj_blog, $xml, ["Content-Type: text/xml"])->getBody(); } - Logger::log('posted to livejournal: ' . ($x) ? $x : '', Logger::DEBUG); + logger('posted to livejournal: ' . ($x) ? $x : '', LOGGER_DEBUG); } } diff --git a/mailstream/mailstream.php b/mailstream/mailstream.php index 1d2a4917..dc44b931 100644 --- a/mailstream/mailstream.php +++ b/mailstream/mailstream.php @@ -10,9 +10,7 @@ use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; -use Friendica\Core\Logger; use Friendica\Core\PConfig; -use Friendica\Core\Renderer; use Friendica\Database\DBA; use Friendica\Util\Network; use Friendica\Model\Item; @@ -75,12 +73,12 @@ function mailstream_module() {} function mailstream_addon_admin(&$a,&$o) { $frommail = Config::get('mailstream', 'frommail'); - $template = Renderer::getMarkupTemplate('admin.tpl', 'addon/mailstream/'); + $template = get_markup_template('admin.tpl', 'addon/mailstream/'); $config = ['frommail', L10n::t('From Address'), $frommail, L10n::t('Email address that stream items will appear to be from.')]; - $o .= Renderer::replaceMacros($template, [ + $o .= replace_macros($template, [ '$frommail' => $config, '$submit' => L10n::t('Save Settings')]); } @@ -96,7 +94,7 @@ function mailstream_generate_id($a, $uri) { $host = $a->getHostName(); $resource = hash('md5', $uri); $message_id = "<" . $resource . "@" . $host . ">"; - Logger::log('mailstream: Generated message ID ' . $message_id . ' for URI ' . $uri, Logger::DEBUG); + logger('mailstream: Generated message ID ' . $message_id . ' for URI ' . $uri, LOGGER_DEBUG); return $message_id; } @@ -125,16 +123,16 @@ function mailstream_post_hook(&$a, &$item) { intval($item['contact-id']), DBA::escape($item['uri']), DBA::escape($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']), DBA::escape($item['uri'])); if (count($r) != 1) { - Logger::log('mailstream_post_remote_hook: Unexpected number of items returned from mailstream_item', Logger::INFO); + logger('mailstream_post_remote_hook: Unexpected number of items returned from mailstream_item', LOGGER_INFO); return; } $ms_item = $r[0]; - Logger::log('mailstream_post_remote_hook: created mailstream_item ' + logger('mailstream_post_remote_hook: created mailstream_item ' . $ms_item['id'] . ' for item ' . $item['uri'] . ' ' - . $item['uid'] . ' ' . $item['contact-id'], Logger::DATA); + . $item['uid'] . ' ' . $item['contact-id'], LOGGER_DATA); $user = mailstream_get_user($item['uid']); if (!$user) { - Logger::log('mailstream_post_remote_hook: no user ' . $item['uid'], Logger::INFO); + logger('mailstream_post_remote_hook: no user ' . $item['uid'], LOGGER_INFO); return; } mailstream_send($a, $ms_item['message-id'], $item, $user); @@ -143,7 +141,7 @@ function mailstream_post_hook(&$a, &$item) { function mailstream_get_user($uid) { $r = q('SELECT * FROM `user` WHERE `uid` = %d', intval($uid)); if (count($r) != 1) { - Logger::log('mailstream_post_remote_hook: Unexpected number of users returned', Logger::INFO); + logger('mailstream_post_remote_hook: Unexpected number of users returned', LOGGER_INFO); return; } return $r[0]; @@ -289,10 +287,10 @@ function mailstream_send($a, $message_id, $item, $user) { } $mail->IsHTML(true); $mail->CharSet = 'utf-8'; - $template = Renderer::getMarkupTemplate('mail.tpl', 'addon/mailstream/'); + $template = get_markup_template('mail.tpl', 'addon/mailstream/'); $item['body'] = BBCode::convert($item['body']); $item['url'] = $a->getBaseURL() . '/display/' . $user['nickname'] . '/' . $item['id']; - $mail->Body = Renderer::replaceMacros($template, [ + $mail->Body = replace_macros($template, [ '$upstream' => L10n::t('Upstream'), '$local' => L10n::t('Local'), '$item' => $item]); @@ -300,11 +298,11 @@ function mailstream_send($a, $message_id, $item, $user) { if (!$mail->Send()) { throw new Exception($mail->ErrorInfo); } - Logger::log('mailstream_send sent message ' . $mail->MessageID . ' ' . $mail->Subject, Logger::DEBUG); + logger('mailstream_send sent message ' . $mail->MessageID . ' ' . $mail->Subject, LOGGER_DEBUG); } catch (phpmailerException $e) { - Logger::log('mailstream_send PHPMailer exception sending message ' . $message_id . ': ' . $e->errorMessage(), Logger::INFO); + logger('mailstream_send PHPMailer exception sending message ' . $message_id . ': ' . $e->errorMessage(), LOGGER_INFO); } catch (Exception $e) { - Logger::log('mailstream_send exception sending message ' . $message_id . ': ' . $e->getMessage(), Logger::INFO); + logger('mailstream_send exception sending message ' . $message_id . ': ' . $e->getMessage(), LOGGER_INFO); } // In case of failure, still set the item to completed. Otherwise // we'll just try to send it over and over again and it'll fail @@ -333,10 +331,10 @@ function mailstream_cron($a, $b) { // mailstream_post_remote_hook fails for some reason will this get // used, and in that case it's worth holding off a bit anyway. $ms_item_ids = q("SELECT `mailstream_item`.`message-id`, `mailstream_item`.`uri`, `item`.`id` FROM `mailstream_item` JOIN `item` ON (`mailstream_item`.`uid` = `item`.`uid` AND `mailstream_item`.`uri` = `item`.`uri` AND `mailstream_item`.`contact-id` = `item`.`contact-id`) WHERE `mailstream_item`.`completed` IS NULL AND `mailstream_item`.`created` < DATE_SUB(NOW(), INTERVAL 1 HOUR) AND `item`.`visible` = 1 ORDER BY `mailstream_item`.`created` LIMIT 100"); - Logger::log('mailstream_cron processing ' . count($ms_item_ids) . ' items', Logger::DEBUG); + logger('mailstream_cron processing ' . count($ms_item_ids) . ' items', LOGGER_DEBUG); foreach ($ms_item_ids as $ms_item_id) { if (!$ms_item_id['message-id'] || !strlen($ms_item_id['message-id'])) { - Logger::log('mailstream_cron: Item ' . $ms_item_id['id'] . ' URI ' . $ms_item_id['uri'] . ' has no message-id', Logger::INFO); + logger('mailstream_cron: Item ' . $ms_item_id['id'] . ' URI ' . $ms_item_id['uri'] . ' has no message-id', LOGGER_INFO); } $item = Item::selectFirst([], ['id' => $ms_item_id['id']]); $users = q("SELECT * FROM `user` WHERE `uid` = %d", intval($item['uid'])); @@ -345,7 +343,7 @@ function mailstream_cron($a, $b) { mailstream_send($a, $ms_item_id['message-id'], $item, $user); } else { - Logger::log('mailstream_cron: Unable to find item ' . $ms_item_id['id'], Logger::INFO); + logger('mailstream_cron: Unable to find item ' . $ms_item_id['id'], LOGGER_INFO); q("UPDATE `mailstream_item` SET `completed` = now() WHERE `message-id` = %d", intval($ms_item['message-id'])); } } @@ -357,8 +355,8 @@ function mailstream_addon_settings(&$a,&$s) { $address = PConfig::get(local_user(), 'mailstream', 'address'); $nolikes = PConfig::get(local_user(), 'mailstream', 'nolikes'); $attachimg= PConfig::get(local_user(), 'mailstream', 'attachimg'); - $template = Renderer::getMarkupTemplate('settings.tpl', 'addon/mailstream/'); - $s .= Renderer::replaceMacros($template, [ + $template = get_markup_template('settings.tpl', 'addon/mailstream/'); + $s .= replace_macros($template, [ '$enabled' => [ 'mailstream_enabled', L10n::t('Enabled'), @@ -414,5 +412,5 @@ function mailstream_tidy() { foreach ($r as $rr) { q('DELETE FROM mailstream_item WHERE id = %d', intval($rr['id'])); } - Logger::log('mailstream_tidy: deleted ' . count($r) . ' old items', Logger::DEBUG); + logger('mailstream_tidy: deleted ' . count($r) . ' old items', LOGGER_DEBUG); } diff --git a/mastodoncustomemojis/mastodoncustomemojis.php b/mastodoncustomemojis/mastodoncustomemojis.php index 1da12dc8..0ce63013 100644 --- a/mastodoncustomemojis/mastodoncustomemojis.php +++ b/mastodoncustomemojis/mastodoncustomemojis.php @@ -6,7 +6,6 @@ * Version: 1.0 * Author: Hypolite Petovan * Author: Roland Haeder - * Status: Unsupported */ use Friendica\App; diff --git a/mathjax/mathjax.php b/mathjax/mathjax.php index ca073e53..9aa07027 100644 --- a/mathjax/mathjax.php +++ b/mathjax/mathjax.php @@ -12,7 +12,6 @@ use Friendica\App; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; -use Friendica\Core\Renderer; function mathjax_install() { @@ -50,8 +49,8 @@ function mathjax_settings(App $a, &$s) $use = PConfig::get(local_user(), 'mathjax', 'use', false); - $tpl = Renderer::getMarkupTemplate('settings.tpl', __DIR__); - $s .= Renderer::replaceMacros($tpl, [ + $tpl = get_markup_template('settings.tpl', __DIR__); + $s .= replace_macros($tpl, [ '$title' => 'MathJax', '$description' => L10n::t('The MathJax addon renders mathematical formulae written using the LaTeX syntax surrounded by the usual $$ or an eqnarray block in the postings of your wall,network tab and private mail.'), '$mathjax_use' => ['mathjax_use', L10n::t('Use the MathJax renderer'), $use, ''], diff --git a/morechoice/lang/de/messages.po b/morechoice/lang/de/messages.po index 4f1bc2d4..b4d20ca3 100644 --- a/morechoice/lang/de/messages.po +++ b/morechoice/lang/de/messages.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-08-07 15:04+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: Vinzenz Vietzke , 2018\n" +"Last-Translator: Tobias Diekershoff , 2018\n" "Language-Team: German (https://www.transifex.com/Friendica/teams/12172/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -120,7 +120,7 @@ msgstr "Millionäre" #: morechoice.php:62 msgid "Guys with big schlongs" -msgstr "Typen mit großen Schwänzen" +msgstr "" #: morechoice.php:63 msgid "Easy women" @@ -236,7 +236,7 @@ msgstr "Muttermilch" #: morechoice.php:91 msgid "Immersing genitals in liquids" -msgstr "Eintauchen von Genitalien in Flüssigkeiten" +msgstr "" #: morechoice.php:92 msgid "Giants" @@ -292,11 +292,11 @@ msgstr "Schlafende Personen" #: morechoice.php:105 msgid "Urination" -msgstr "Urinieren" +msgstr "" #: morechoice.php:106 msgid "Eating people" -msgstr "Essende Menschen" +msgstr "" #: morechoice.php:107 msgid "Being eaten" diff --git a/morechoice/lang/de/strings.php b/morechoice/lang/de/strings.php index c1ea3ba6..682d2ba1 100644 --- a/morechoice/lang/de/strings.php +++ b/morechoice/lang/de/strings.php @@ -31,7 +31,7 @@ $a->strings["Can't remember"] = "Kann mich nicht erinnern"; $a->strings["Hard to tell these days"] = "Schwer zu sagen dieser Tage"; $a->strings["Girls with big tits"] = "Mädels mit großen Brüsten"; $a->strings["Millionaires"] = "Millionäre"; -$a->strings["Guys with big schlongs"] = "Typen mit großen Schwänzen"; +$a->strings["Guys with big schlongs"] = ""; $a->strings["Easy women"] = "Leichte Frauen"; $a->strings["People with impaired mobility"] = "Menschen mit eingeschränkter Mobilität"; $a->strings["Amputees"] = "Amputierte"; @@ -60,7 +60,7 @@ $a->strings["Transgender people"] = "Transgender Personen"; $a->strings["Criminals"] = "Kriminelle"; $a->strings["Stealing"] = "Stehlen"; $a->strings["Breast milk"] = "Muttermilch"; -$a->strings["Immersing genitals in liquids"] = "Eintauchen von Genitalien in Flüssigkeiten"; +$a->strings["Immersing genitals in liquids"] = ""; $a->strings["Giants"] = "Riesen"; $a->strings["Masochism"] = "Masochismus"; $a->strings["Cars"] = "Autos"; @@ -74,8 +74,8 @@ $a->strings["Smells"] = "Gerüche"; $a->strings["Buttocks"] = "Hintern"; $a->strings["Nonliving objects"] = "Leblose Objekte"; $a->strings["Sleeping people"] = "Schlafende Personen"; -$a->strings["Urination"] = "Urinieren"; -$a->strings["Eating people"] = "Essende Menschen"; +$a->strings["Urination"] = ""; +$a->strings["Eating people"] = ""; $a->strings["Being eaten"] = "Verspeist zu werden"; $a->strings["Animals"] = "Tiere"; $a->strings["I'd rather just have some chocolate"] = "Ich bevorzuge eine Tafel Schokolade"; diff --git a/newmemberwidget/newmemberwidget.php b/newmemberwidget/newmemberwidget.php index 8ecbaaa9..d7f38068 100644 --- a/newmemberwidget/newmemberwidget.php +++ b/newmemberwidget/newmemberwidget.php @@ -10,14 +10,11 @@ use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; -use Friendica\Core\Logger; -use Friendica\Core\Renderer; -use Friendica\Util\Strings; function newmemberwidget_install() { Addon::registerHook( 'network_mod_init', 'addon/newmemberwidget/newmemberwidget.php', 'newmemberwidget_network_mod_init'); - Logger::log('newmemberwidget installed'); + logger('newmemberwidget installed'); } function newmemberwidget_uninstall() @@ -55,7 +52,7 @@ function newmemberwidget_network_mod_init ($a, $b) function newmemberwidget_addon_admin_post(&$a) { $ft = ((x($_POST, 'freetext')) ? trim($_POST['freetext']) : ""); - $lsn = ((x($_POST, 'localsupportname')) ? Strings::escapeTags(trim($_POST['localsupportname'])) : ""); + $lsn = ((x($_POST, 'localsupportname')) ? notags(trim($_POST['localsupportname'])) : ""); $gs = intval($_POST['linkglobalsupport']); $ls = intval($_POST['linklocalsupport']); Config::set('newmemberwidget', 'freetext', trim($ft)); @@ -66,8 +63,8 @@ function newmemberwidget_addon_admin_post(&$a) function newmemberwidget_addon_admin(&$a, &$o) { - $t = Renderer::getMarkupTemplate('admin.tpl', 'addon/newmemberwidget'); - $o = Renderer::replaceMacros($t, [ + $t = get_markup_template('admin.tpl', 'addon/newmemberwidget'); + $o = replace_macros($t, [ '$submit' => L10n::t('Save Settings'), '$freetext' => [ "freetext", L10n::t("Message"), Config::get("newmemberwidget", "freetext"), L10n::t("Your message for new members. You can use bbcode here.")], '$linkglobalsupport' => [ "linkglobalsupport", L10n::t('Add a link to global support forum'), Config::get('newmemberwidget', 'linkglobalsupport'), L10n::t('Should a link to the global support forum be displayed?')." (@helpers)"], diff --git a/notifyall/notifyall.php b/notifyall/notifyall.php index ea6712f1..852972c3 100644 --- a/notifyall/notifyall.php +++ b/notifyall/notifyall.php @@ -12,18 +12,16 @@ use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Core\Config; use Friendica\Core\L10n; -use Friendica\Core\Logger; -use Friendica\Core\Renderer; use Friendica\Util\Emailer; function notifyall_install() { - Logger::log("installed notifyall"); + logger("installed notifyall"); } function notifyall_uninstall() { - Logger::log("removed notifyall"); + logger("removed notifyall"); } function notifyall_module() {} @@ -106,7 +104,7 @@ function notifyall_content(&$a) $title = L10n::t('Send email to all members of this Friendica instance.'); - $o = Renderer::replaceMacros(Renderer::getMarkupTemplate('notifyall_form.tpl', 'addon/notifyall/'), [ + $o = replace_macros(get_markup_template('notifyall_form.tpl', 'addon/notifyall/'), [ '$title' => $title, '$text' => htmlspecialchars(defaults($_REQUEST, 'text', '')), '$subject' => ['subject', L10n::t('Message subject'), defaults($_REQUEST, 'subject', ''),''], diff --git a/numfriends/numfriends.php b/numfriends/numfriends.php index 9e22b0ea..0cfea736 100644 --- a/numfriends/numfriends.php +++ b/numfriends/numfriends.php @@ -7,7 +7,6 @@ */ use Friendica\Core\Addon; use Friendica\Core\L10n; -use Friendica\Core\Logger; use Friendica\Core\PConfig; function numfriends_install() { @@ -15,7 +14,7 @@ function numfriends_install() { Addon::registerHook('addon_settings', 'addon/numfriends/numfriends.php', 'numfriends_settings'); Addon::registerHook('addon_settings_post', 'addon/numfriends/numfriends.php', 'numfriends_settings_post'); - Logger::log("installed numfriends"); + logger("installed numfriends"); } @@ -25,7 +24,7 @@ function numfriends_uninstall() { Addon::unregisterHook('addon_settings_post', 'addon/numfriends/numfriends.php', 'numfriends_settings_post'); - Logger::log("removed numfriends"); + logger("removed numfriends"); } /** diff --git a/openstreetmap/openstreetmap.php b/openstreetmap/openstreetmap.php index 0410931e..c8eb43a9 100644 --- a/openstreetmap/openstreetmap.php +++ b/openstreetmap/openstreetmap.php @@ -12,11 +12,8 @@ use Friendica\Core\Addon; use Friendica\Core\Cache; use Friendica\Core\Config; use Friendica\Core\L10n; -use Friendica\Core\Logger; -use Friendica\Core\Renderer; use Friendica\Core\System; use Friendica\Util\Network; -use Friendica\Util\Strings; const OSM_TMS = 'https://www.openstreetmap.org'; const OSM_NOM = 'https://nominatim.openstreetmap.org/search.php'; @@ -32,7 +29,7 @@ function openstreetmap_install() Addon::registerHook('Map::getCoordinates', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_get_coordinates'); Addon::registerHook('page_header', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_alterheader'); - Logger::log("installed openstreetmap"); + logger("installed openstreetmap"); } function openstreetmap_uninstall() @@ -44,7 +41,7 @@ function openstreetmap_uninstall() Addon::unregisterHook('Map::getCoordinates', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_get_coordinates'); Addon::unregisterHook('page_header', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_alterheader'); - Logger::log("removed openstreetmap"); + logger("removed openstreetmap"); } function openstreetmap_load_config(\Friendica\App $a) @@ -168,8 +165,8 @@ function openstreetmap_generate_map(&$a, &$b) $lat = $b['lat']; // round($b['lat'], 5); $lon = $b['lon']; // round($b['lon'], 5); - Logger::log('lat: ' . $lat, Logger::DATA); - Logger::log('lon: ' . $lon, Logger::DATA); + logger('lat: ' . $lat, LOGGER_DATA); + logger('lon: ' . $lon, LOGGER_DATA); $cardlink = '' . ($b['location'] ? Strings::escapeHtml($b['location']) : L10n::t('View Larger')) . ''; + $cardlink .= '#map=' . $zoom . '/' . $lat . '/' . $lon . '">' . ($b['location'] ? escape_tags($b['location']) : L10n::t('View Larger')) . ''; if (empty($b['mode'])) { $b['html'] = '