]> git.mxchange.org Git - friendica.git/blobdiff - mod/hovercard.php
Merge pull request #6225 from annando/http-error
[friendica.git] / mod / hovercard.php
index 8b51eb00ae6b14881dde6128b32603b10e2228ea..6160642762a4adcbc427d6f21b048fa62df60c19 100644 (file)
 
 use Friendica\App;
 use Friendica\Core\Config;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
 use Friendica\Model\GContact;
 use Friendica\Util\Proxy as ProxyUtils;
+use Friendica\Util\Strings;
 
 function hovercard_init(App $a)
 {
@@ -54,7 +56,7 @@ function hovercard_content()
 
        $contact = [];
        // if it's the url containing https it should be converted to http
-       $nurl = normalise_link(GContact::cleanContactUrl($profileurl));
+       $nurl = Strings::normaliseLink(GContact::cleanContactUrl($profileurl));
        if (!$nurl) {
                return;
        }
@@ -72,12 +74,12 @@ function hovercard_content()
 
        // Feeds url could have been destroyed through "cleanContactUrl", so we now use the original url
        if (!count($contact) && local_user()) {
-               $nurl = normalise_link($profileurl);
+               $nurl = Strings::normaliseLink($profileurl);
                $contact = Contact::getDetailsByURL($nurl, local_user());
        }
 
        if (!count($contact)) {
-               $nurl = normalise_link($profileurl);
+               $nurl = Strings::normaliseLink($profileurl);
                $contact = Contact::getDetailsByURL($nurl);
        }
 
@@ -103,15 +105,15 @@ function hovercard_content()
                'location' => $contact['location'],
                'gender'   => $contact['gender'],
                'about'    => $contact['about'],
-               'network'  => format_network_name($contact['network'], $contact['url']),
+               'network'  => Strings::formatNetworkName($contact['network'], $contact['url']),
                'tags'     => $contact['keywords'],
-               'bd'       => $contact['birthday'] <= '0001-01-01' ? '' : $contact['birthday'],
+               'bd'       => $contact['birthday'] <= DBA::NULL_DATE ? '' : $contact['birthday'],
                'account_type' => Contact::getAccountType($contact),
                'actions'  => $actions,
        ];
        if ($datatype == 'html') {
-               $tpl = get_markup_template('hovercard.tpl');
-               $o = replace_macros($tpl, [
+               $tpl = Renderer::getMarkupTemplate('hovercard.tpl');
+               $o = Renderer::replaceMacros($tpl, [
                        '$profile' => $profile,
                ]);
 
@@ -133,7 +135,7 @@ function get_template_content($template, $root = '')
 {
        // We load the whole template system to get the filename.
        // Maybe we can do it a little bit smarter if I get time.
-       $t = get_markup_template($template, $root);
+       $t = Renderer::getMarkupTemplate($template, $root);
        $filename = $t->filename;
 
        // Get the content of the template file