]> git.mxchange.org Git - friendica.git/blobdiff - src/Render/FriendicaSmartyEngine.php
Merge pull request #9507 from MrPetovan/bug/9480-never-mention-yourself
[friendica.git] / src / Render / FriendicaSmartyEngine.php
index 9b3739d987e8ec90e6e516f6881c0742a72579cc..0f5ee21f27ea3fc6bdc8593b91266ad11448e65b 100644 (file)
@@ -49,8 +49,12 @@ final class FriendicaSmartyEngine extends TemplateEngine
                $this->smarty = new FriendicaSmarty($this->theme, $this->theme_info);
 
                if (!is_writable(DI::basePath() . '/view/smarty3')) {
-                       DI::logger()->critical(DI::l10n()->t('The folder view/smarty3/ must be writable by webserver.'));
-                       throw new InternalServerErrorException(DI::l10n()->t('Friendica can\'t display this page at the moment, please contact the administrator or check the Friendica log for errors.'));
+                       $admin_message = DI::l10n()->t('The folder view/smarty3/ must be writable by webserver.');
+                       DI::logger()->critical($admin_message);
+                       $message = is_site_admin() ?
+                               $admin_message :
+                               DI::l10n()->t('Friendica can\'t display this page at the moment, please contact the administrator.');
+                       throw new InternalServerErrorException($message);
                }
        }
 
@@ -79,6 +83,8 @@ final class FriendicaSmartyEngine extends TemplateEngine
                Hook::callAll('template_vars', $arr);
                $vars = $arr['vars'];
 
+               $this->smarty->clearAllAssign();
+
                foreach ($vars as $key => $value) {
                        if ($key[0] === '$') {
                                $key = substr($key, 1);