diff --git a/advancedcontentfilter/advancedcontentfilter.php b/advancedcontentfilter/advancedcontentfilter.php index 3f036488..3067b513 100644 --- a/advancedcontentfilter/advancedcontentfilter.php +++ b/advancedcontentfilter/advancedcontentfilter.php @@ -35,6 +35,7 @@ use Friendica\App; use Friendica\BaseModule; +use Friendica\Content\Text; use Friendica\Content\Text\Markdown; use Friendica\Core\Addon; use Friendica\Core\Cache; @@ -206,8 +207,8 @@ function advancedcontentfilter_content(App $a) return $html; } else { - $t = get_markup_template('settings.tpl', 'addon/advancedcontentfilter/'); - return replace_macros($t, [ + $t = Text::getMarkupTemplate('settings.tpl', 'addon/advancedcontentfilter/'); + return Text::replaceMacros($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 9b2d5b62..c317eb4a 100644 --- a/blackout/blackout.php +++ b/blackout/blackout.php @@ -49,6 +49,7 @@ * THE SOFTWARE. */ +use Friendica\Content\Text; use Friendica\Core\Config; use Friendica\Core\Addon; use Friendica\Core\L10n; @@ -84,7 +85,7 @@ function blackout_redirect ($a, $b) { $date2 = 0; } if (( $date1 <= $now ) && ( $now <= $date2 )) { - logger('redirecting user to blackout page'); + Text::logger('redirecting user to blackout page'); System::externalRedirect($myurl); } } @@ -96,9 +97,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 = get_markup_template( "admin.tpl", "addon/blackout/" ); + $t = Text::getMarkupTemplate( "admin.tpl", "addon/blackout/" ); - $o = replace_macros($t, [ + $o = Text::replaceMacros($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 2a5fd8b6..853a7279 100644 --- a/blockem/blockem.php +++ b/blockem/blockem.php @@ -8,6 +8,7 @@ */ use Friendica\App; +use Friendica\Content\Text; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; @@ -100,7 +101,7 @@ function blockem_enotify_store(App $a, array &$b) continue; } - if (link_compare($b['url'], $word)) { + if (Text::linkCompare($b['url'], $word)) { $found = true; break; } @@ -133,7 +134,7 @@ function blockem_prepare_body_content_filter(App $a, array &$hook_data) $found = false; foreach ($profiles_array as $word) { - if (link_compare($hook_data['item']['author-link'], trim($word))) { + if (Text::linkCompare($hook_data['item']['author-link'], trim($word))) { $found = true; break; } @@ -192,7 +193,7 @@ function blockem_item_photo_menu(App $a, array &$b) if (!empty($a->data['blockem'])) { foreach($a->data['blockem'] as $bloke) { - if (link_compare($bloke,$author)) { + if (Text::linkCompare($bloke,$author)) { $blocked = true; break; } @@ -231,7 +232,7 @@ function blockem_init(App $a) if (count($arr)) { foreach ($arr as $x) { - if (!link_compare(trim($x), trim($_GET['unblock']))) { + if (!Text::linkCompare(trim($x), trim($_GET['unblock']))) { $newarr[] = $x; } } diff --git a/blogger/blogger.php b/blogger/blogger.php index 00563c3a..18333aba 100644 --- a/blogger/blogger.php +++ b/blogger/blogger.php @@ -7,6 +7,7 @@ */ use Friendica\App; +use Friendica\Content\Text; use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\L10n; @@ -177,14 +178,14 @@ function blogger_send(App $a, array &$b) return; } - $bl_username = xmlify(PConfig::get($b['uid'], 'blogger', 'bl_username')); - $bl_password = xmlify(PConfig::get($b['uid'], 'blogger', 'bl_password')); + $bl_username = Text::xmlify(PConfig::get($b['uid'], 'blogger', 'bl_username')); + $bl_password = Text::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 = xmlify($post); + $post = Text::xmlify($post); $xml = <<< EOT @@ -202,12 +203,12 @@ function blogger_send(App $a, array &$b) EOT; - logger('blogger: data: ' . $xml, LOGGER_DATA); + Text::logger('blogger: data: ' . $xml, LOGGER_DATA); if ($bl_blog !== 'test') { $x = Network::post($bl_blog, $xml)->getBody(); } - logger('posted to blogger: ' . (($x) ? $x : ''), LOGGER_DEBUG); + Text::logger('posted to blogger: ' . (($x) ? $x : ''), LOGGER_DEBUG); } } diff --git a/buffer/buffer.php b/buffer/buffer.php index 048a27da..4eb9a594 100644 --- a/buffer/buffer.php +++ b/buffer/buffer.php @@ -8,6 +8,7 @@ require 'addon/buffer/bufferapp.php'; use Friendica\App; +use Friendica\Content\Text; use Friendica\Content\Text\Plaintext; use Friendica\Core\Addon; use Friendica\Core\Config; @@ -69,9 +70,9 @@ function buffer_content(App $a) function buffer_addon_admin(App $a, &$o) { - $t = get_markup_template("admin.tpl", "addon/buffer/"); + $t = Text::getMarkupTemplate("admin.tpl", "addon/buffer/"); - $o = replace_macros($t, [ + $o = Text::replaceMacros($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'), ''], @@ -81,8 +82,8 @@ function buffer_addon_admin(App $a, &$o) function buffer_addon_admin_post(App $a) { - $client_id = ((!empty($_POST['client_id'])) ? notags(trim($_POST['client_id'])) : ''); - $client_secret = ((!empty($_POST['client_secret'])) ? notags(trim($_POST['client_secret'])) : ''); + $client_id = ((!empty($_POST['client_id'])) ? Text::noTags(trim($_POST['client_id'])) : ''); + $client_secret = ((!empty($_POST['client_secret'])) ? Text::noTags(trim($_POST['client_secret'])) : ''); Config::set('buffer', 'client_id' , $client_id); Config::set('buffer', 'client_secret', $client_secret); @@ -112,7 +113,7 @@ function buffer_connect(App $a) if (!$buffer->ok) { $o .= 'Connect to Buffer!'; } else { - logger("buffer_connect: authenticated"); + Text::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); @@ -298,7 +299,7 @@ function buffer_send(App $a, array &$b) $profiles = $buffer->go('/profiles'); if (is_array($profiles)) { - logger("Will send these parameter ".print_r($b, true), LOGGER_DEBUG); + Text::logger("Will send these parameter ".print_r($b, true), LOGGER_DEBUG); foreach ($profiles as $profile) { if (!$profile->default) @@ -357,7 +358,7 @@ function buffer_send(App $a, array &$b) } $post = ItemContent::getPlaintextPost($item, $limit, $includedlinks, $htmlmode); - logger("buffer_send: converted message ".$b["id"]." result: ".print_r($post, true), LOGGER_DEBUG); + Text::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"])) { @@ -407,9 +408,9 @@ function buffer_send(App $a, array &$b) } //print_r($message); - logger("buffer_send: data for message " . $b["id"] . ": " . print_r($message, true), LOGGER_DEBUG); + Text::logger("buffer_send: data for message " . $b["id"] . ": " . print_r($message, true), LOGGER_DEBUG); $ret = $buffer->go('/updates/create', $message); - logger("buffer_send: send message " . $b["id"] . " result: " . print_r($ret, true), LOGGER_DEBUG); + Text::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 b321ae33..c2e6f986 100644 --- a/catavatar/catavatar.php +++ b/catavatar/catavatar.php @@ -7,6 +7,7 @@ */ use Friendica\App; +use Frienidica\Content\Text; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -28,7 +29,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('registered catavatar'); + Text::logger('registered catavatar'); } /** @@ -40,7 +41,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('unregistered catavatar'); + Text::logger('unregistered catavatar'); } /** @@ -52,8 +53,8 @@ function catavatar_addon_settings(App $a, &$s) return; } - $t = get_markup_template('settings.tpl', 'addon/catavatar/'); - $s .= replace_macros ($t, [ + $t = Text::getMarkupTemplate('settings.tpl', 'addon/catavatar/'); + $s .= Text::replaceMacros ($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 db244c7d..80e245c6 100644 --- a/curweather/curweather.php +++ b/curweather/curweather.php @@ -12,6 +12,7 @@ require_once 'include/text.php'; use Friendica\App; +use Friendica\Content\Text; use Friendica\Core\Addon; use Friendica\Core\Cache; use Friendica\Core\Config; @@ -135,8 +136,8 @@ function curweather_network_mod_init(App $a, &$b) } if ($ok) { - $t = get_markup_template("widget.tpl", "addon/curweather/" ); - $curweather = replace_macros ($t, [ + $t = Text::getMarkupTemplate("widget.tpl", "addon/curweather/" ); + $curweather = Text::replaceMacros ($t, [ '$title' => L10n::t("Current Weather"), '$icon' => ProxyUtils::proxifyUrl('http://openweathermap.org/img/w/'.$res['icon'].'.png'), '$city' => $res['city'], @@ -152,8 +153,8 @@ function curweather_network_mod_init(App $a, &$b) '$showonmap' => L10n::t('Show on map') ]); } else { - $t = get_markup_template('widget-error.tpl', 'addon/curweather/'); - $curweather = replace_macros( $t, [ + $t = Text::getMarkupTemplate('widget-error.tpl', 'addon/curweather/'); + $curweather = Text::replaceMacros( $t, [ '$problem' => L10n::t('There was a problem accessing the weather data. But have a look'), '$rpt' => $rpt, '$atOWM' => L10n::t('at OpenWeatherMap') @@ -197,9 +198,9 @@ function curweather_addon_settings(App $a, &$s) $enable_checked = (($enable) ? ' checked="checked" ' : ''); // load template and replace the macros - $t = get_markup_template("settings.tpl", "addon/curweather/" ); + $t = Text::getMarkupTemplate("settings.tpl", "addon/curweather/" ); - $s = replace_macros ($t, [ + $s = Text::replaceMacros ($t, [ '$submit' => L10n::t('Save Settings'), '$header' => L10n::t('Current Weather').' '.L10n::t('Settings'), '$noappidtext' => $noappidtext, @@ -237,9 +238,9 @@ function curweather_addon_admin(App $a, &$o) $appid = Config::get('curweather', 'appid'); $cachetime = Config::get('curweather', 'cachetime'); - $t = get_markup_template("admin.tpl", "addon/curweather/" ); + $t = Text::getMarkupTemplate("admin.tpl", "addon/curweather/" ); - $o = replace_macros ($t, [ + $o = Text::replaceMacros ($t, [ '$submit' => L10n::t('Save Settings'), '$cachetime' => [ 'cachetime', diff --git a/diaspora/diaspora.php b/diaspora/diaspora.php index 44bc1f74..bb34bac0 100644 --- a/diaspora/diaspora.php +++ b/diaspora/diaspora.php @@ -10,6 +10,7 @@ require_once 'addon/diaspora/Diaspora_Connection.php'; use Friendica\App; +use Friendica\Content\Text; use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\L10n; @@ -72,7 +73,7 @@ function diaspora_queue_hook(App $a, &$b) { continue; } - logger('diaspora_queue: run'); + Text::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", @@ -92,37 +93,37 @@ function diaspora_queue_hook(App $a, &$b) { $success = false; if ($handle && $password) { - logger('diaspora_queue: able to post for user '.$handle); + Text::logger('diaspora_queue: able to post for user '.$handle); $z = unserialize($x['content']); $post = $z['post']; - logger('diaspora_queue: post: '.$post, LOGGER_DATA); + Text::logger('diaspora_queue: post: '.$post, LOGGER_DATA); try { - logger('diaspora_queue: prepare', LOGGER_DEBUG); + Text::logger('diaspora_queue: prepare', LOGGER_DEBUG); $conn = new Diaspora_Connection($handle, $password); - logger('diaspora_queue: try to log in '.$handle, LOGGER_DEBUG); + Text::logger('diaspora_queue: try to log in '.$handle, LOGGER_DEBUG); $conn->logIn(); - logger('diaspora_queue: try to send '.$body, LOGGER_DEBUG); + Text::logger('diaspora_queue: try to send '.$body, LOGGER_DEBUG); $conn->provider = $hostname; $conn->postStatusMessage($post, $aspect); - logger('diaspora_queue: send '.$userdata['uid'].' success', LOGGER_DEBUG); + Text::logger('diaspora_queue: send '.$userdata['uid'].' success', LOGGER_DEBUG); $success = true; Queue::removeItem($x['id']); } catch (Exception $e) { - logger("diaspora_queue: Send ".$userdata['uid']." failed: ".$e->getMessage(), LOGGER_DEBUG); + Text::logger("diaspora_queue: Send ".$userdata['uid']." failed: ".$e->getMessage(), LOGGER_DEBUG); } } else { - logger('diaspora_queue: send '.$userdata['uid'].' missing username or password', LOGGER_DEBUG); + Text::logger('diaspora_queue: send '.$userdata['uid'].' missing username or password', LOGGER_DEBUG); } if (!$success) { - logger('diaspora_queue: delayed'); + Text::logger('diaspora_queue: delayed'); Queue::updateTime($x['id']); } } @@ -289,7 +290,7 @@ function diaspora_send(App $a, array &$b) { $hostname = $a->getHostName(); - logger('diaspora_send: invoked'); + Text::logger('diaspora_send: invoked'); if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) { return; @@ -311,14 +312,14 @@ function diaspora_send(App $a, array &$b) return; } - logger('diaspora_send: prepare posting', LOGGER_DEBUG); + Text::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('diaspora_send: all values seem to be okay', LOGGER_DEBUG); + Text::logger('diaspora_send: all values seem to be okay', LOGGER_DEBUG); $tag_arr = []; $tags = ''; @@ -363,20 +364,20 @@ function diaspora_send(App $a, array &$b) require_once "addon/diaspora/diasphp.php"; try { - logger('diaspora_send: prepare', LOGGER_DEBUG); + Text::logger('diaspora_send: prepare', LOGGER_DEBUG); $conn = new Diaspora_Connection($handle, $password); - logger('diaspora_send: try to log in '.$handle, LOGGER_DEBUG); + Text::logger('diaspora_send: try to log in '.$handle, LOGGER_DEBUG); $conn->logIn(); - logger('diaspora_send: try to send '.$body, LOGGER_DEBUG); + Text::logger('diaspora_send: try to send '.$body, LOGGER_DEBUG); $conn->provider = $hostname; $conn->postStatusMessage($body, $aspect); - logger('diaspora_send: success'); + Text::logger('diaspora_send: success'); } catch (Exception $e) { - logger("diaspora_send: Error submitting the post: " . $e->getMessage()); + Text::logger("diaspora_send: Error submitting the post: " . $e->getMessage()); - logger('diaspora_send: requeueing '.$b['uid'], LOGGER_DEBUG); + Text::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 bc8959fc..4766ef5c 100644 --- a/dwpost/dwpost.php +++ b/dwpost/dwpost.php @@ -9,6 +9,7 @@ */ use Friendica\App; +use Friendica\Content\Text; use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\L10n; @@ -188,7 +189,7 @@ function dwpost_send(App $a, array &$b) if ($dw_username && $dw_password && $dw_blog) { $title = $b['title']; $post = BBCode::convert($b['body']); - $post = xmlify($post); + $post = Text::xmlify($post); $tags = dwpost_get_tags($b['tag']); $date = DateTimeFormat::convert($b['created'], $tz); @@ -225,13 +226,13 @@ function dwpost_send(App $a, array &$b) EOT; - logger('dwpost: data: ' . $xml, LOGGER_DATA); + Text::logger('dwpost: data: ' . $xml, LOGGER_DATA); if ($dw_blog !== 'test') { $x = Network::post($dw_blog, $xml, ["Content-Type: text/xml"])->getBody(); } - logger('posted to dreamwidth: ' . ($x) ? $x : '', LOGGER_DEBUG); + Text::logger('posted to dreamwidth: ' . ($x) ? $x : '', LOGGER_DEBUG); } } diff --git a/forumdirectory/forumdirectory.php b/forumdirectory/forumdirectory.php index 54818cdb..64e8c554 100644 --- a/forumdirectory/forumdirectory.php +++ b/forumdirectory/forumdirectory.php @@ -9,6 +9,7 @@ use Friendica\App; use Friendica\Content\Nav; use Friendica\Content\Pager; +use Friendica\Content\Text; use Friendica\Content\Widget; use Friendica\Core\Addon; use Friendica\Core\Config; @@ -71,12 +72,12 @@ function forumdirectory_content(App $a) Nav::setSelected('directory'); if (!empty($a->data['search'])) { - $search = notags(trim($a->data['search'])); + $search = Text::noTags(trim($a->data['search'])); } else { - $search = ((!empty($_GET['search'])) ? notags(trim(rawurldecode($_GET['search']))) : ''); + $search = ((!empty($_GET['search'])) ? Text::noTags(trim(rawurldecode($_GET['search']))) : ''); } - $tpl = get_markup_template('directory_header.tpl'); + $tpl = Text::getMarkupTemplate('directory_header.tpl'); $globaldir = ''; $gdirpath = Config::get('system', 'directory'); @@ -87,7 +88,7 @@ function forumdirectory_content(App $a) $admin = ''; - $o .= replace_macros($tpl, [ + $o .= Text::replaceMacros($tpl, [ '$search' => $search, '$globaldir' => $globaldir, '$desc' => L10n::t('Find on this site'), @@ -187,9 +188,9 @@ function forumdirectory_content(App $a) $homepage = !empty($profile['homepage']) ? L10n::t('Homepage:') : false; $about = !empty($profile['about']) ? L10n::t('About:') : false; - $tpl = get_markup_template('forumdirectory_item.tpl', 'addon/forumdirectory/'); + $tpl = Text::getMarkupTemplate('forumdirectory_item.tpl', 'addon/forumdirectory/'); - $entry = replace_macros($tpl, [ + $entry = Text::replaceMacros($tpl, [ '$id' => $rr['id'], '$profile_link' => $profile_link, '$photo' => $rr[$photo], diff --git a/fromapp/fromapp.php b/fromapp/fromapp.php index 6a33cd03..73543799 100644 --- a/fromapp/fromapp.php +++ b/fromapp/fromapp.php @@ -6,6 +6,7 @@ * Author: Commander Zot * */ +use Friendica\Content\Text; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; @@ -15,7 +16,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("installed fromapp"); + Text::logger("installed fromapp"); } @@ -24,7 +25,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("removed fromapp"); + Text::logger("removed fromapp"); } function fromapp_settings_post($a, $post) diff --git a/fromgplus/fromgplus.php b/fromgplus/fromgplus.php index 9dc48753..5971cf58 100644 --- a/fromgplus/fromgplus.php +++ b/fromgplus/fromgplus.php @@ -9,6 +9,7 @@ define('FROMGPLUS_DEFAULT_POLL_INTERVAL', 30); // given in minutes +use Friendica\Content\Text; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -101,9 +102,9 @@ function fromgplus_addon_settings_post(&$a,&$b) { function fromgplus_addon_admin(&$a, &$o) { - $t = get_markup_template("admin.tpl", "addon/fromgplus/"); + $t = Text::getMarkupTemplate("admin.tpl", "addon/fromgplus/"); - $o = replace_macros($t, [ + $o = Text::replaceMacros($t, [ '$submit' => L10n::t('Save Settings'), '$key' => ['key', L10n::t('Key'), trim(Config::get('fromgplus', 'key')), ''], ]); @@ -126,25 +127,25 @@ function fromgplus_cron($a,$b) { if($last) { $next = $last + ($poll_interval * 60); if($next > time()) { - logger('fromgplus: poll intervall not reached'); + Text::logger('fromgplus: poll intervall not reached'); return; } } - logger('fromgplus: cron_start'); + Text::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('fromgplus: fetching for user '.$rr['uid']); + Text::logger('fromgplus: fetching for user '.$rr['uid']); fromgplus_fetch($a, $rr['uid']); } } } - logger('fromgplus: cron_end'); + Text::logger('fromgplus: cron_end'); Config::set('fromgplus','last_poll', time()); } @@ -190,15 +191,15 @@ function fromgplus_post($a, $uid, $source, $body, $location, $coord, $id) { $_REQUEST['coord'] = $coord; if (($_REQUEST['title'] == "") && ($_REQUEST['body'] == "")) { - logger('fromgplus: empty post for user '.$uid." ".print_r($_REQUEST, true)); + Text::logger('fromgplus: empty post for user '.$uid." ".print_r($_REQUEST, true)); return; } require_once('mod/item.php'); //print_r($_REQUEST); - logger('fromgplus: posting for user '.$uid." ".print_r($_REQUEST, true)); + Text::logger('fromgplus: posting for user '.$uid." ".print_r($_REQUEST, true)); item_post($a); - logger('fromgplus: done for user '.$uid); + Text::logger('fromgplus: done for user '.$uid); } function fromgplus_html2bbcode($html) { @@ -472,7 +473,7 @@ function fromgplus_fetch($a, $uid) { // Don't publish items that are too young if (strtotime($item->published) > (time() - 3*60)) { - logger('fromgplus_fetch: item too new '.$item->published); + Text::logger('fromgplus_fetch: item too new '.$item->published); continue; } diff --git a/geocoordinates/geocoordinates.php b/geocoordinates/geocoordinates.php index 89ccd883..9368d70a 100644 --- a/geocoordinates/geocoordinates.php +++ b/geocoordinates/geocoordinates.php @@ -5,6 +5,8 @@ * Version: 0.1 * Author: Michael Vogel */ + +use Friendica\Content\Text; use Friendica\Core\Addon; use Friendica\Core\Cache; use Friendica\Core\Config; @@ -54,25 +56,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("API could not be queried", LOGGER_DEBUG); + Text::logger("API could not be queried", LOGGER_DEBUG); return; } $data = json_decode($s); if ($data->status->code != "200") { - logger("API returned error ".$data->status->code." ".$data->status->message, LOGGER_DEBUG); + Text::logger("API returned error ".$data->status->code." ".$data->status->message, LOGGER_DEBUG); return; } if (($data->total_results == 0) || (count($data->results) == 0)) { - logger("No results found for coordinates ".$item["coord"], LOGGER_DEBUG); + Text::logger("No results found for coordinates ".$item["coord"], LOGGER_DEBUG); return; } $item["location"] = $data->results[0]->formatted; - logger("Got location for coordinates ".$coords[0]."-".$coords[1].": ".$item["location"], LOGGER_DEBUG); + Text::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"]); @@ -86,9 +88,9 @@ function geocoordinates_post_hook($a, &$item) function geocoordinates_addon_admin(&$a, &$o) { - $t = get_markup_template("admin.tpl", "addon/geocoordinates/"); + $t = Text::getMarkupTemplate("admin.tpl", "addon/geocoordinates/"); - $o = replace_macros($t, [ + $o = Text::replaceMacros($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'), ''], @@ -97,10 +99,10 @@ function geocoordinates_addon_admin(&$a, &$o) function geocoordinates_addon_admin_post(&$a) { - $api_key = ((x($_POST, 'api_key')) ? notags(trim($_POST['api_key'])) : ''); + $api_key = ((x($_POST, 'api_key')) ? Text::noTags(trim($_POST['api_key'])) : ''); Config::set('geocoordinates', 'api_key', $api_key); - $language = ((x($_POST, 'language')) ? notags(trim($_POST['language'])) : ''); + $language = ((x($_POST, 'language')) ? Text::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 dc6e116b..2ea4bb4a 100644 --- a/geonames/geonames.php +++ b/geonames/geonames.php @@ -21,6 +21,7 @@ * system will call the name_uninstall() function. * */ +use Friendica\Content\Text; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -52,7 +53,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("installed geonames"); + Text::logger("installed geonames"); } @@ -72,7 +73,7 @@ function geonames_uninstall() { Addon::unregisterHook('addon_settings_post', 'addon/geonames/geonames.php', 'geonames_addon_admin_post'); - logger("removed geonames"); + Text::logger("removed geonames"); } function geonames_load_config(\Friendica\App $a) @@ -91,7 +92,7 @@ function geonames_post_hook($a, &$item) { * */ - logger('geonames invoked'); + Text::logger('geonames invoked'); if(! local_user()) /* non-zero if this is a logged in user of this system */ return; @@ -132,7 +133,7 @@ function geonames_post_hook($a, &$item) { $item['location'] = $xml->geoname->name . ', ' . $xml->geoname->countryName; -// logger('geonames : ' . print_r($xml,true), LOGGER_DATA); +// Text::logger('geonames : ' . print_r($xml,true), LOGGER_DATA); return; } diff --git a/gnot/gnot.php b/gnot/gnot.php index 2c4555ba..8a7284b1 100644 --- a/gnot/gnot.php +++ b/gnot/gnot.php @@ -7,6 +7,7 @@ * * */ +use Friendica\Content\Text; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; @@ -17,7 +18,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("installed gnot"); + Text::logger("installed gnot"); } @@ -28,7 +29,7 @@ function gnot_uninstall() { Addon::unregisterHook('enotify_mail', 'addon/gnot/gnot.php', 'gnot_enotify_mail'); - logger("removed gnot"); + Text::logger("removed gnot"); } diff --git a/googlemaps/googlemaps.php b/googlemaps/googlemaps.php index e294c8e0..58374cf5 100644 --- a/googlemaps/googlemaps.php +++ b/googlemaps/googlemaps.php @@ -6,6 +6,7 @@ * Author: Michael Vogel * */ +use Friendica\Content\Text; use Friendica\Core\Addon; use Friendica\Core\Cache; @@ -13,14 +14,14 @@ function googlemaps_install() { Addon::registerHook('render_location', 'addon/googlemaps/googlemaps.php', 'googlemaps_location'); - logger("installed googlemaps"); + Text::logger("installed googlemaps"); } function googlemaps_uninstall() { Addon::unregisterHook('render_location', 'addon/googlemaps/googlemaps.php', 'googlemaps_location'); - logger("removed googlemaps"); + Text::logger("removed googlemaps"); } function googlemaps_location($a, &$item) diff --git a/gravatar/gravatar.php b/gravatar/gravatar.php index 9a23edfe..c263bdec 100644 --- a/gravatar/gravatar.php +++ b/gravatar/gravatar.php @@ -8,6 +8,7 @@ use Friendica\App; use Friendica\BaseModule; +use Friendica\Content\Text; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -21,7 +22,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("registered gravatar in avatar_lookup hook"); + Text::logger("registered gravatar in avatar_lookup hook"); } /** @@ -31,7 +32,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("unregistered gravatar in avatar_lookup hook"); + Text::logger("unregistered gravatar in avatar_lookup hook"); } function gravatar_load_config(App $a) @@ -70,7 +71,7 @@ function gravatar_lookup($a, &$b) { * Display admin settings for this addon */ function gravatar_addon_admin (&$a, &$o) { - $t = get_markup_template( "admin.tpl", "addon/gravatar/" ); + $t = Text::getMarkupTemplate( "admin.tpl", "addon/gravatar/" ); $default_avatar = Config::get('gravatar', 'default_avatar'); $rating = Config::get('gravatar', 'rating'); @@ -106,7 +107,7 @@ function gravatar_addon_admin (&$a, &$o) { // output Gravatar settings $o .= ''; - $o .= replace_macros( $t, [ + $o .= Text::replaceMacros( $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], @@ -119,8 +120,8 @@ function gravatar_addon_admin (&$a, &$o) { function gravatar_addon_admin_post (&$a) { BaseModule::checkFormSecurityToken('gravatarsave'); - $default_avatar = ((x($_POST, 'avatar')) ? notags(trim($_POST['avatar'])) : 'identicon'); - $rating = ((x($_POST, 'rating')) ? notags(trim($_POST['rating'])) : 'g'); + $default_avatar = ((x($_POST, 'avatar')) ? Text::noTags(trim($_POST['avatar'])) : 'identicon'); + $rating = ((x($_POST, 'rating')) ? Text::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 3f91ff35..506ad93b 100644 --- a/group_text/group_text.php +++ b/group_text/group_text.php @@ -5,6 +5,7 @@ * Version: 1.0 * Author: Thomas Willingham */ +use Friendica\Content\Text; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; @@ -14,7 +15,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("installed group_text"); + Text::logger("installed group_text"); } @@ -24,7 +25,7 @@ function group_text_uninstall() { Addon::unregisterHook('addon_settings_post', 'addon/group_text/group_text.php', 'group_text_settings_post'); - logger("removed group_text"); + Text::logger("removed group_text"); } diff --git a/ifttt/ifttt.php b/ifttt/ifttt.php index 2e48319a..780d6ad2 100644 --- a/ifttt/ifttt.php +++ b/ifttt/ifttt.php @@ -11,6 +11,7 @@ require_once 'include/items.php'; require_once 'include/text.php'; use Friendica\App; +use Friendica\Content\Text; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; @@ -103,16 +104,16 @@ function ifttt_post(App $a) $user = DBA::selectFirst('user', ['uid'], ['nickname' => $nickname]); if (!DBA::isResult($user)) { - logger('User ' . $nickname . ' not found.', LOGGER_DEBUG); + Text::logger('User ' . $nickname . ' not found.', LOGGER_DEBUG); return; } $uid = $user['uid']; - logger('Received a post for user ' . $uid . ' from ifttt ' . print_r($_REQUEST, true), LOGGER_DEBUG); + Text::logger('Received a post for user ' . $uid . ' from ifttt ' . print_r($_REQUEST, true), LOGGER_DEBUG); if (!isset($_REQUEST['key'])) { - logger('No key found.'); + Text::logger('No key found.'); return; } @@ -120,7 +121,7 @@ function ifttt_post(App $a) // Check the key if ($key != PConfig::get($uid, 'ifttt', 'key')) { - logger('Invalid key for user ' . $uid, LOGGER_DEBUG); + Text::logger('Invalid key for user ' . $uid, LOGGER_DEBUG); return; } @@ -131,7 +132,7 @@ function ifttt_post(App $a) } if (!in_array($item['type'], ['status', 'link', 'photo'])) { - logger('Unknown item type ' . $item['type'], LOGGER_DEBUG); + Text::logger('Unknown item type ' . $item['type'], LOGGER_DEBUG); return; } diff --git a/ijpost/ijpost.php b/ijpost/ijpost.php index 3dcfb31f..ee17c5ca 100644 --- a/ijpost/ijpost.php +++ b/ijpost/ijpost.php @@ -8,6 +8,7 @@ * Author: Cat Gray */ +use Friendica\Content\Text; use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\L10n; @@ -184,7 +185,7 @@ function ijpost_send(&$a, &$b) if ($ij_username && $ij_password && $ij_blog) { $title = $b['title']; $post = BBCode::convert($b['body']); - $post = xmlify($post); + $post = Text::xmlify($post); $tags = ijpost_get_tags($b['tag']); $date = DateTimeFormat::convert($b['created'], $tz); @@ -221,12 +222,12 @@ function ijpost_send(&$a, &$b) EOT; - logger('ijpost: data: ' . $xml, LOGGER_DATA); + Text::logger('ijpost: data: ' . $xml, LOGGER_DATA); if ($ij_blog !== 'test') { $x = Network::post($ij_blog, $xml, ["Content-Type: text/xml"])->getBody(); } - logger('posted to insanejournal: ' . $x ? $x : '', LOGGER_DEBUG); + Text::logger('posted to insanejournal: ' . $x ? $x : '', LOGGER_DEBUG); } } diff --git a/impressum/impressum.php b/impressum/impressum.php index 90775116..43de556f 100644 --- a/impressum/impressum.php +++ b/impressum/impressum.php @@ -7,6 +7,7 @@ * License: 3-clause BSD license */ +use Friendica\Content\Text; use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\Config; @@ -17,14 +18,14 @@ 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("installed impressum Addon"); + Text::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("uninstalled impressum Addon"); + Text::logger("uninstalled impressum Addon"); } function impressum_module() { @@ -84,11 +85,11 @@ function impressum_show($a,&$b) { } function impressum_addon_admin_post (&$a) { - $owner = ((x($_POST, 'owner')) ? notags(trim($_POST['owner'])) : ''); - $ownerprofile = ((x($_POST, 'ownerprofile')) ? notags(trim($_POST['ownerprofile'])) : ''); + $owner = ((x($_POST, 'owner')) ? Text::noTags(trim($_POST['owner'])) : ''); + $ownerprofile = ((x($_POST, 'ownerprofile')) ? Text::noTags(trim($_POST['ownerprofile'])) : ''); $postal = ((x($_POST, 'postal')) ? (trim($_POST['postal'])) : ''); $notes = ((x($_POST, 'notes')) ? (trim($_POST['notes'])) : ''); - $email = ((x($_POST, 'email')) ? notags(trim($_POST['email'])) : ''); + $email = ((x($_POST, 'email')) ? Text::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)); @@ -99,8 +100,8 @@ function impressum_addon_admin_post (&$a) { info(L10n::t('Settings updated.'). EOL ); } function impressum_addon_admin (&$a, &$o) { - $t = get_markup_template( "admin.tpl", "addon/impressum/" ); - $o = replace_macros($t, [ + $t = Text::getMarkupTemplate( "admin.tpl", "addon/impressum/" ); + $o = Text::replaceMacros($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 38ce5f24..31ae7668 100644 --- a/irc/irc.php +++ b/irc/irc.php @@ -6,6 +6,8 @@ * Author: tony baldwin * Author: Tobias Diekershoff */ + +use Friendica\Content\Text; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -36,8 +38,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 = get_markup_template( "settings.tpl", "addon/irc/" ); - $s .= replace_macros($t, [ + $t = Text::getMarkupTemplate( "settings.tpl", "addon/irc/" ); + $s .= Text::replaceMacros($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'), @@ -135,8 +137,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 = get_markup_template( "admin.tpl", "addon/irc/" ); - $o = replace_macros($t, [ + $t = Text::getMarkupTemplate( "admin.tpl", "addon/irc/" ); + $o = Text::replaceMacros($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 8111f9fd..75a5073f 100644 --- a/jappixmini/jappixmini.php +++ b/jappixmini/jappixmini.php @@ -63,6 +63,7 @@ */ use Friendica\App; +use Friendica\Content\Text; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -584,7 +585,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("jappixmini: Update list of contacts' jabber accounts for " . count($users) . " users."); + Text::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 adeba838..b93d4714 100644 --- a/js_upload/js_upload.php +++ b/js_upload/js_upload.php @@ -14,6 +14,7 @@ * Module Author: Chris Case * */ +use Friendica\Content\Text; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -159,7 +160,7 @@ function js_upload_post_init(&$a,&$b) { $a->data['upload_jsonresponse'] = htmlspecialchars(json_encode($result), ENT_NOQUOTES); if(isset($result['error'])) { - logger('mod/photos.php: photos_post(): error uploading photo: ' . $result['error'] , 'LOGGER_DEBUG'); + Text::logger('mod/photos.php: photos_post(): error uploading photo: ' . $result['error'] , 'LOGGER_DEBUG'); echo json_encode($result); killme(); } @@ -181,7 +182,7 @@ function js_upload_post_file(&$a,&$b) { function js_upload_post_end(&$a,&$b) { -logger('upload_post_end'); +Text::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 4b6e1f7f..93a85a0f 100644 --- a/krynn/krynn.php +++ b/krynn/krynn.php @@ -9,6 +9,7 @@ * *"My body was my sacrifice... for my magic. This damage is permanent." - Raistlin Majere */ +use Friendica\Content\Text; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; @@ -35,7 +36,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("installed krynn"); + Text::logger("installed krynn"); } @@ -54,7 +55,7 @@ function krynn_uninstall() { Addon::unregisterHook('addon_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post'); - logger("removed krynn"); + Text::logger("removed krynn"); } @@ -70,7 +71,7 @@ function krynn_post_hook($a, &$item) { * */ - logger('krynn invoked'); + Text::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 6922ac82..48eaa181 100644 --- a/langfilter/langfilter.php +++ b/langfilter/langfilter.php @@ -8,6 +8,7 @@ */ use Friendica\App; +use Friendica\Content\Text; use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\L10n; @@ -50,8 +51,8 @@ function langfilter_addon_settings(App $a, &$s) $minconfidence = PConfig::get(local_user(), 'langfilter', 'minconfidence') * 100; $minlength = PConfig::get(local_user(), 'langfilter', 'minlength'); - $t = get_markup_template("settings.tpl", "addon/langfilter/"); - $s .= replace_macros($t, [ + $t = Text::getMarkupTemplate("settings.tpl", "addon/langfilter/"); + $s .= Text::replaceMacros($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 514fb1d1..f801f547 100644 --- a/ldapauth/ldapauth.php +++ b/ldapauth/ldapauth.php @@ -53,6 +53,7 @@ * * ...etc. */ +use Friendica\Content\Text; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Model\User; @@ -99,28 +100,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("ldapauth: not configured or missing php-ldap module"); + Text::logger("ldapauth: not configured or missing php-ldap module"); return false; } $connect = @ldap_connect($ldap_server); if ($connect === false) { - logger("ldapauth: could not connect to $ldap_server"); + Text::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("ldapauth: could not bind $ldap_server as $ldap_binddn"); + Text::logger("ldapauth: could not bind $ldap_server as $ldap_binddn"); return false; } $res = @ldap_search($connect, $ldap_searchdn, $ldap_userattr . '=' . $username); if (!$res) { - logger("ldapauth: $ldap_userattr=$username,$ldap_searchdn not found"); + Text::logger("ldapauth: $ldap_userattr=$username,$ldap_searchdn not found"); return false; } @@ -161,13 +162,13 @@ function ldapauth_authenticate($username, $password) @ldap_close($connect); if ($eno === 32) { - logger("ldapauth: access control group Does Not Exist"); + Text::logger("ldapauth: access control group Does Not Exist"); return false; } elseif ($eno === 16) { - logger('ldapauth: membership attribute does not exist in access control group'); + Text::logger('ldapauth: membership attribute does not exist in access control group'); return false; } else { - logger('ldapauth: error: ' . $err); + Text::logger('ldapauth: error: ' . $err); return false; } } elseif ($r === false) { @@ -189,12 +190,12 @@ function ldap_autocreateaccount($ldap_autocreateaccount, $username, $password, $ try { User::create($arr); - logger("ldapauth: account " . $username . " created"); + Text::logger("ldapauth: account " . $username . " created"); } catch (Exception $ex) { - logger("ldapauth: account " . $username . " was not created ! : " . $ex->getMessage()); + Text::logger("ldapauth: account " . $username . " was not created ! : " . $ex->getMessage()); } } else { - logger("ldapauth: unable to create account, no email or nickname found"); + Text::logger("ldapauth: unable to create account, no email or nickname found"); } } } diff --git a/leistungsschutzrecht/leistungsschutzrecht.php b/leistungsschutzrecht/leistungsschutzrecht.php index c0625ccb..06668f87 100644 --- a/leistungsschutzrecht/leistungsschutzrecht.php +++ b/leistungsschutzrecht/leistungsschutzrecht.php @@ -5,6 +5,7 @@ * Version: 0.1 * Author: Michael Vogel */ +use Friendica\Content\Text; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Util\Network; @@ -163,7 +164,7 @@ function leistungsschutzrecht_cron($a,$b) { if($last) { $next = $last + 86400; if($next > time()) { - logger('poll intervall not reached'); + Text::logger('poll intervall not reached'); return; } } diff --git a/libertree/libertree.php b/libertree/libertree.php index 19512bc5..5d28af51 100644 --- a/libertree/libertree.php +++ b/libertree/libertree.php @@ -6,6 +6,7 @@ * Author: Tony Baldwin */ +use Friendica\Content\Text; use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\L10n; @@ -157,7 +158,7 @@ function libertree_post_local(&$a,&$b) { function libertree_send(&$a,&$b) { - logger('libertree_send: invoked'); + Text::logger('libertree_send: invoked'); if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) { return; @@ -232,6 +233,6 @@ function libertree_send(&$a,&$b) { ]; $result = Network::post($ltree_blog, $params)->getBody(); - logger('libertree: ' . $result); + Text::logger('libertree: ' . $result); } } diff --git a/libravatar/libravatar.php b/libravatar/libravatar.php index bc671548..e09bff27 100644 --- a/libravatar/libravatar.php +++ b/libravatar/libravatar.php @@ -8,6 +8,7 @@ use Friendica\App; use Friendica\BaseModule; +use Friendica\Content\Text; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -21,7 +22,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("registered libravatar in avatar_lookup hook"); + Text::logger("registered libravatar in avatar_lookup hook"); } /** @@ -31,7 +32,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("unregistered libravatar in avatar_lookup hook"); + Text::logger("unregistered libravatar in avatar_lookup hook"); } function libravatar_load_config(App $a) @@ -73,7 +74,7 @@ function libravatar_lookup($a, &$b) */ function libravatar_addon_admin(&$a, &$o) { - $t = get_markup_template("admin.tpl", "addon/libravatar"); + $t = Text::getMarkupTemplate("admin.tpl", "addon/libravatar"); $default_avatar = Config::get('libravatar', 'default_avatar'); @@ -109,7 +110,7 @@ function libravatar_addon_admin(&$a, &$o) // output Libravatar settings $o .= ''; - $o .= replace_macros( $t, [ + $o .= Text::replaceMacros( $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], ]); @@ -122,7 +123,7 @@ function libravatar_addon_admin_post(&$a) { BaseModule::checkFormSecurityToken('libravatarrsave'); - $default_avatar = ((x($_POST, 'avatar')) ? notags(trim($_POST['avatar'])) : 'identicon'); + $default_avatar = ((x($_POST, 'avatar')) ? Text::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 dfc1387b..940f8af0 100644 --- a/ljpost/ljpost.php +++ b/ljpost/ljpost.php @@ -8,6 +8,7 @@ * Author: Cat Gray */ +use Friendica\Content\Text; use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\L10n; @@ -168,20 +169,20 @@ function ljpost_send(&$a,&$b) { if($x && strlen($x[0]['timezone'])) $tz = $x[0]['timezone']; - $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')); + $lj_username = Text::xmlify(PConfig::get($b['uid'],'ljpost','lj_username')); + $lj_password = Text::xmlify(PConfig::get($b['uid'],'ljpost','lj_password')); + $lj_journal = Text::xmlify(PConfig::get($b['uid'],'ljpost','lj_journal')); // if(! $lj_journal) // $lj_journal = $lj_username; - $lj_blog = xmlify(PConfig::get($b['uid'],'ljpost','lj_blog')); + $lj_blog = Text::xmlify(PConfig::get($b['uid'],'ljpost','lj_blog')); if(! strlen($lj_blog)) - $lj_blog = xmlify('http://www.livejournal.com/interface/xmlrpc'); + $lj_blog = Text::xmlify('http://www.livejournal.com/interface/xmlrpc'); if($lj_username && $lj_password && $lj_blog) { - $title = xmlify($b['title']); + $title = Text::xmlify($b['title']); $post = BBCode::convert($b['body']); - $post = xmlify($post); + $post = Text::xmlify($post); $tags = ljpost_get_tags($b['tag']); $date = DateTimeFormat::convert($b['created'], $tz); @@ -231,12 +232,12 @@ function ljpost_send(&$a,&$b) { EOT; - logger('ljpost: data: ' . $xml, LOGGER_DATA); + Text::logger('ljpost: data: ' . $xml, LOGGER_DATA); if ($lj_blog !== 'test') { $x = Network::post($lj_blog, $xml, ["Content-Type: text/xml"])->getBody(); } - logger('posted to livejournal: ' . ($x) ? $x : '', LOGGER_DEBUG); + Text::logger('posted to livejournal: ' . ($x) ? $x : '', LOGGER_DEBUG); } } diff --git a/mailstream/mailstream.php b/mailstream/mailstream.php index dc44b931..211dfb69 100644 --- a/mailstream/mailstream.php +++ b/mailstream/mailstream.php @@ -6,6 +6,7 @@ * Author: Matthew Exon */ +use Friendica\Content\Text; use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\Config; @@ -73,12 +74,12 @@ function mailstream_module() {} function mailstream_addon_admin(&$a,&$o) { $frommail = Config::get('mailstream', 'frommail'); - $template = get_markup_template('admin.tpl', 'addon/mailstream/'); + $template = Text::getMarkupTemplate('admin.tpl', 'addon/mailstream/'); $config = ['frommail', L10n::t('From Address'), $frommail, L10n::t('Email address that stream items will appear to be from.')]; - $o .= replace_macros($template, [ + $o .= Text::replaceMacros($template, [ '$frommail' => $config, '$submit' => L10n::t('Save Settings')]); } @@ -94,7 +95,7 @@ function mailstream_generate_id($a, $uri) { $host = $a->getHostName(); $resource = hash('md5', $uri); $message_id = "<" . $resource . "@" . $host . ">"; - logger('mailstream: Generated message ID ' . $message_id . ' for URI ' . $uri, LOGGER_DEBUG); + Text::logger('mailstream: Generated message ID ' . $message_id . ' for URI ' . $uri, LOGGER_DEBUG); return $message_id; } @@ -123,16 +124,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('mailstream_post_remote_hook: Unexpected number of items returned from mailstream_item', LOGGER_INFO); + Text::logger('mailstream_post_remote_hook: Unexpected number of items returned from mailstream_item', LOGGER_INFO); return; } $ms_item = $r[0]; - logger('mailstream_post_remote_hook: created mailstream_item ' + Text::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_INFO); + Text::logger('mailstream_post_remote_hook: no user ' . $item['uid'], LOGGER_INFO); return; } mailstream_send($a, $ms_item['message-id'], $item, $user); @@ -141,7 +142,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('mailstream_post_remote_hook: Unexpected number of users returned', LOGGER_INFO); + Text::logger('mailstream_post_remote_hook: Unexpected number of users returned', LOGGER_INFO); return; } return $r[0]; @@ -287,10 +288,10 @@ function mailstream_send($a, $message_id, $item, $user) { } $mail->IsHTML(true); $mail->CharSet = 'utf-8'; - $template = get_markup_template('mail.tpl', 'addon/mailstream/'); + $template = Text::getMarkupTemplate('mail.tpl', 'addon/mailstream/'); $item['body'] = BBCode::convert($item['body']); $item['url'] = $a->getBaseURL() . '/display/' . $user['nickname'] . '/' . $item['id']; - $mail->Body = replace_macros($template, [ + $mail->Body = Text::replaceMacros($template, [ '$upstream' => L10n::t('Upstream'), '$local' => L10n::t('Local'), '$item' => $item]); @@ -298,11 +299,11 @@ function mailstream_send($a, $message_id, $item, $user) { if (!$mail->Send()) { throw new Exception($mail->ErrorInfo); } - logger('mailstream_send sent message ' . $mail->MessageID . ' ' . $mail->Subject, LOGGER_DEBUG); + Text::logger('mailstream_send sent message ' . $mail->MessageID . ' ' . $mail->Subject, LOGGER_DEBUG); } catch (phpmailerException $e) { - logger('mailstream_send PHPMailer exception sending message ' . $message_id . ': ' . $e->errorMessage(), LOGGER_INFO); + Text::logger('mailstream_send PHPMailer exception sending message ' . $message_id . ': ' . $e->errorMessage(), LOGGER_INFO); } catch (Exception $e) { - logger('mailstream_send exception sending message ' . $message_id . ': ' . $e->getMessage(), LOGGER_INFO); + Text::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 @@ -331,10 +332,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('mailstream_cron processing ' . count($ms_item_ids) . ' items', LOGGER_DEBUG); + Text::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('mailstream_cron: Item ' . $ms_item_id['id'] . ' URI ' . $ms_item_id['uri'] . ' has no message-id', LOGGER_INFO); + Text::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'])); @@ -343,7 +344,7 @@ function mailstream_cron($a, $b) { mailstream_send($a, $ms_item_id['message-id'], $item, $user); } else { - logger('mailstream_cron: Unable to find item ' . $ms_item_id['id'], LOGGER_INFO); + Text::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'])); } } @@ -355,8 +356,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 = get_markup_template('settings.tpl', 'addon/mailstream/'); - $s .= replace_macros($template, [ + $template = Text::getMarkupTemplate('settings.tpl', 'addon/mailstream/'); + $s .= Text::replaceMacros($template, [ '$enabled' => [ 'mailstream_enabled', L10n::t('Enabled'), @@ -412,5 +413,5 @@ function mailstream_tidy() { 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); + Text::logger('mailstream_tidy: deleted ' . count($r) . ' old items', LOGGER_DEBUG); } diff --git a/mathjax/mathjax.php b/mathjax/mathjax.php index 9aa07027..ad07fd48 100644 --- a/mathjax/mathjax.php +++ b/mathjax/mathjax.php @@ -9,6 +9,7 @@ */ use Friendica\App; +use Friendica\Content\Text; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; @@ -49,8 +50,8 @@ function mathjax_settings(App $a, &$s) $use = PConfig::get(local_user(), 'mathjax', 'use', false); - $tpl = get_markup_template('settings.tpl', __DIR__); - $s .= replace_macros($tpl, [ + $tpl = Text::getMarkupTemplate('settings.tpl', __DIR__); + $s .= Text::replaceMacros($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/newmemberwidget/newmemberwidget.php b/newmemberwidget/newmemberwidget.php index d7f38068..e4e27691 100644 --- a/newmemberwidget/newmemberwidget.php +++ b/newmemberwidget/newmemberwidget.php @@ -6,6 +6,7 @@ * Author: Tobias Diekershoff ***/ +use Friendica\Content\Text; use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\Config; @@ -14,7 +15,7 @@ use Friendica\Core\L10n; function newmemberwidget_install() { Addon::registerHook( 'network_mod_init', 'addon/newmemberwidget/newmemberwidget.php', 'newmemberwidget_network_mod_init'); - logger('newmemberwidget installed'); + Text::logger('newmemberwidget installed'); } function newmemberwidget_uninstall() @@ -52,7 +53,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')) ? notags(trim($_POST['localsupportname'])) : ""); + $lsn = ((x($_POST, 'localsupportname')) ? Text::noTags(trim($_POST['localsupportname'])) : ""); $gs = intval($_POST['linkglobalsupport']); $ls = intval($_POST['linklocalsupport']); Config::set('newmemberwidget', 'freetext', trim($ft)); @@ -63,8 +64,8 @@ function newmemberwidget_addon_admin_post(&$a) function newmemberwidget_addon_admin(&$a, &$o) { - $t = get_markup_template('admin.tpl', 'addon/newmemberwidget'); - $o = replace_macros($t, [ + $t = Text::getMarkupTemplate('admin.tpl', 'addon/newmemberwidget'); + $o = Text::replaceMacros($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 852972c3..460dfd39 100644 --- a/notifyall/notifyall.php +++ b/notifyall/notifyall.php @@ -9,6 +9,7 @@ */ use Friendica\App; +use Friendica\Content\Text; use Friendica\Content\Text\BBCode; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -16,12 +17,12 @@ use Friendica\Util\Emailer; function notifyall_install() { - logger("installed notifyall"); + Text::logger("installed notifyall"); } function notifyall_uninstall() { - logger("removed notifyall"); + Text::logger("removed notifyall"); } function notifyall_module() {} @@ -104,7 +105,7 @@ function notifyall_content(&$a) $title = L10n::t('Send email to all members of this Friendica instance.'); - $o = replace_macros(get_markup_template('notifyall_form.tpl', 'addon/notifyall/'), [ + $o = Text::replaceMacros(Text::getMarkupTemplate('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 0cfea736..5a7f5315 100644 --- a/numfriends/numfriends.php +++ b/numfriends/numfriends.php @@ -5,6 +5,7 @@ * Version: 1.0 * Author: Mike Macgirvin */ +use Friendica\Content\Text; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; @@ -14,7 +15,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("installed numfriends"); + Text::logger("installed numfriends"); } @@ -24,7 +25,7 @@ function numfriends_uninstall() { Addon::unregisterHook('addon_settings_post', 'addon/numfriends/numfriends.php', 'numfriends_settings_post'); - logger("removed numfriends"); + Text::logger("removed numfriends"); } /** diff --git a/openstreetmap/openstreetmap.php b/openstreetmap/openstreetmap.php index c8eb43a9..a27dd3e0 100644 --- a/openstreetmap/openstreetmap.php +++ b/openstreetmap/openstreetmap.php @@ -8,6 +8,8 @@ * Author: Klaus Weidenbach * */ + +use Friendica\Content\Text; use Friendica\Core\Addon; use Friendica\Core\Cache; use Friendica\Core\Config; @@ -29,7 +31,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("installed openstreetmap"); + Text::logger("installed openstreetmap"); } function openstreetmap_uninstall() @@ -41,7 +43,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("removed openstreetmap"); + Text::logger("removed openstreetmap"); } function openstreetmap_load_config(\Friendica\App $a) @@ -165,8 +167,8 @@ function openstreetmap_generate_map(&$a, &$b) $lat = $b['lat']; // round($b['lat'], 5); $lon = $b['lon']; // round($b['lon'], 5); - logger('lat: ' . $lat, LOGGER_DATA); - logger('lon: ' . $lon, LOGGER_DATA); + Text::logger('lat: ' . $lat, LOGGER_DATA); + Text::logger('lon: ' . $lon, LOGGER_DATA); $cardlink = '' . ($b['location'] ? escape_tags($b['location']) : L10n::t('View Larger')) . ''; + $cardlink .= '#map=' . $zoom . '/' . $lat . '/' . $lon . '">' . ($b['location'] ? Text::escapeTags($b['location']) : L10n::t('View Larger')) . ''; if (empty($b['mode'])) { $b['html'] = '