]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Profile.php
Merge pull request #6132 from annando/notice
[friendica.git] / src / Model / Profile.php
index a98cb30d87ed68f59d562c9aea90022206427fa2..c45bcdb84bd6fa75e6322386724cc5225310d8fa 100644 (file)
@@ -8,6 +8,7 @@ use Friendica\App;
 use Friendica\Content\Feature;
 use Friendica\Content\ForumManager;
 use Friendica\Content\Text\BBCode;
+use Friendica\Content\Text\HTML;
 use Friendica\Core\Addon;
 use Friendica\Core\Cache;
 use Friendica\Core\Config;
@@ -24,6 +25,7 @@ use Friendica\Protocol\Diaspora;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Network;
 use Friendica\Util\Proxy as ProxyUtils;
+use Friendica\Util\Strings;
 use Friendica\Util\Temporal;
 
 require_once 'include/dba.php';
@@ -164,7 +166,7 @@ class Profile
                * load/reload current theme info
                */
 
-               $a->setActiveTemplateEngine(); // reset the template engine to the default in case the user's theme doesn't specify one
+               Renderer::setActiveTemplateEngine(); // reset the template engine to the default in case the user's theme doesn't specify one
 
                $theme_info_file = 'view/theme/' . $a->getCurrentTheme() . '/theme.php';
                if (file_exists($theme_info_file)) {
@@ -295,7 +297,7 @@ class Profile
                $profile['picdate'] = urlencode(defaults($profile, 'picdate', ''));
 
                if (($profile['network'] != '') && ($profile['network'] != Protocol::DFRN)) {
-                       $profile['network_name'] = format_network_name($profile['network'], $profile['url']);
+                       $profile['network_name'] = Strings::formatNetworkName($profile['network'], $profile['url']);
                } else {
                        $profile['network_name'] = '';
                }
@@ -325,9 +327,9 @@ class Profile
                // Is the local user already connected to that user?
                if ($connect && local_user()) {
                        if (isset($profile['url'])) {
-                               $profile_url = normalise_link($profile['url']);
+                               $profile_url = Strings::normaliseLink($profile['url']);
                        } else {
-                               $profile_url = normalise_link(System::baseUrl() . '/profile/' . $profile['nickname']);
+                               $profile_url = Strings::normaliseLink(System::baseUrl() . '/profile/' . $profile['nickname']);
                        }
 
                        if (DBA::exists('contact', ['pending' => false, 'uid' => local_user(), 'nurl' => $profile_url])) {
@@ -369,7 +371,7 @@ class Profile
                                $r = q(
                                        "SELECT `url` FROM `contact` WHERE `uid` = %d AND `nurl` = '%s' AND `rel` = %d",
                                        intval($profile['uid']),
-                                       DBA::escape(normalise_link(self::getMyURL())),
+                                       DBA::escape(Strings::normaliseLink(self::getMyURL())),
                                        intval(Contact::FRIEND)
                                );
                        }
@@ -467,7 +469,7 @@ class Profile
                $updated = '';
                $contacts = 0;
                if (!$block) {
-                       $contact_block = contact_block();
+                       $contact_block = HTML::contactBlock();
 
                        if (is_array($a->profile) && !$a->profile['hide-friends']) {
                                $r = q(
@@ -616,7 +618,7 @@ class Profile
 
                                        $rr['link'] = Contact::magicLink($rr['url']);
                                        $rr['title'] = $rr['name'];
-                                       $rr['date'] = day_translate(DateTimeFormat::convert($rr['start'], $a->timezone, 'UTC', $rr['adjust'] ? $bd_format : $bd_short)) . (($today) ? ' ' . L10n::t('[today]') : '');
+                                       $rr['date'] = L10n::getDay(DateTimeFormat::convert($rr['start'], $a->timezone, 'UTC', $rr['adjust'] ? $bd_format : $bd_short)) . (($today) ? ' ' . L10n::t('[today]') : '');
                                        $rr['startime'] = null;
                                        $rr['today'] = $today;
                                }
@@ -702,7 +704,7 @@ class Profile
 
                                $rr['title'] = $title;
                                $rr['description'] = $description;
-                               $rr['date'] = day_translate(DateTimeFormat::convert($rr['start'], $rr['adjust'] ? $a->timezone : 'UTC', 'UTC', $bd_format)) . (($today) ? ' ' . L10n::t('[today]') : '');
+                               $rr['date'] = L10n::getDay(DateTimeFormat::convert($rr['start'], $rr['adjust'] ? $a->timezone : 'UTC', 'UTC', $bd_format)) . (($today) ? ' ' . L10n::t('[today]') : '');
                                $rr['startime'] = $strt;
                                $rr['today'] = $today;
 
@@ -751,7 +753,7 @@ class Profile
                                $year_bd_format = L10n::t('j F, Y');
                                $short_bd_format = L10n::t('j F');
 
-                               $val = day_translate(
+                               $val = L10n::getDay(
                                        intval($a->profile['dob']) ?
                                                DateTimeFormat::utc($a->profile['dob'] . ' 00:00 +00:00', $year_bd_format)
                                                : DateTimeFormat::utc('2001-' . substr($a->profile['dob'], 5) . ' 00:00 +00:00', $short_bd_format)
@@ -785,11 +787,11 @@ class Profile
                        }
 
                        if ($a->profile['homepage']) {
-                               $profile['homepage'] = [L10n::t('Homepage:'), linkify($a->profile['homepage'])];
+                               $profile['homepage'] = [L10n::t('Homepage:'), HTML::toLink($a->profile['homepage'])];
                        }
 
                        if ($a->profile['hometown']) {
-                               $profile['hometown'] = [L10n::t('Hometown:'), linkify($a->profile['hometown'])];
+                               $profile['hometown'] = [L10n::t('Hometown:'), HTML::toLink($a->profile['hometown'])];
                        }
 
                        if ($a->profile['pub_keywords']) {
@@ -880,7 +882,7 @@ class Profile
 
                $tab = false;
                if (x($_GET, 'tab')) {
-                       $tab = notags(trim($_GET['tab']));
+                       $tab = Strings::escapeTags(trim($_GET['tab']));
                }
 
                $url = System::baseUrl() . '/profile/' . $nickname;
@@ -1139,7 +1141,7 @@ class Profile
                }
                $achar = strpos($s, '?') ? '&' : '?';
                $mine = self::getMyURL();
-               if ($mine && !link_compare($mine, $s)) {
+               if ($mine && !Strings::compareLink($mine, $s)) {
                        return $s . $achar . 'zrl=' . urlencode($mine);
                }
                return $s;