X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fhovercard.php;h=ca399196368b71b3151d616924b8e59a8ab19cca;hb=b55546b72649a645987e017397901a86122eba67;hp=f71977f074e190ffb648295545d5967917c38bae;hpb=af9067a381430b520a155bd3803a338d44cfaace;p=friendica.git diff --git a/mod/hovercard.php b/mod/hovercard.php index f71977f074..ca39919636 100644 --- a/mod/hovercard.php +++ b/mod/hovercard.php @@ -31,7 +31,7 @@ function hovercard_content() // Get out if the system doesn't have public access allowed if (intval(Config::get('system', 'block_public'))) { - System::httpExit(401); + throw new \Friendica\Network\HTTPException\ForbiddenException(); } // Return the raw content of the template. We use this to make templates usable for js functions. @@ -47,7 +47,6 @@ function hovercard_content() // If a contact is connected the url is internally changed to 'redir/CID'. We need the pure url to search for // the contact. So we strip out the contact id from the internal url and look in the contact table for // the real url (nurl) - $cid = 0; if (strpos($profileurl, 'redir/') === 0) { $cid = intval(substr($profileurl, 6)); $remote_contact = DBA::selectFirst('contact', ['nurl'], ['id' => $cid]); @@ -136,8 +135,10 @@ 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 = Renderer::getMarkupTemplate($template, $root); - $filename = $t->filename; + $templateEngine = Renderer::getTemplateEngine(); + $template = $templateEngine->getTemplateFile($template, $root); + + $filename = $template->filename; // Get the content of the template file if (file_exists($filename)) {