X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FRenderer.php;h=fd5e73302512f0d8328690958941d2e356b8415c;hb=f70271aa5d40ce48ec92f1c6ec652c6a977e588c;hp=72073086ab33d5bfcbab1bdf0a5e9748dcc4c70f;hpb=58c9566c3d086583a1a55901c8c1c865d5f94891;p=friendica.git diff --git a/src/Core/Renderer.php b/src/Core/Renderer.php index 72073086ab..fd5e733025 100644 --- a/src/Core/Renderer.php +++ b/src/Core/Renderer.php @@ -52,22 +52,20 @@ class Renderer extends BaseObject /** * @brief This is our template processor * - * @param string|FriendicaSmarty $s The string requiring macro substitution or an instance of FriendicaSmarty - * @param array $vars key value pairs (search => replace) - * @param bool $overwriteURL Overwrite the base url with the system wide set base url + * @param string|FriendicaSmarty $s The string requiring macro substitution or an instance of FriendicaSmarty + * @param array $vars Key value pairs (search => replace) * * @return string substituted string - * @throws \Friendica\Network\HTTPException\InternalServerErrorException + * @throws Exception */ - public static function replaceMacros($s, $vars, $overwriteURL = true) + public static function replaceMacros($s, array $vars = []) { $stamp1 = microtime(true); $a = self::getApp(); - // pass $baseurl to all templates - if ($overwriteURL) { - $vars['$baseurl'] = System::baseUrl(); - } + // pass $baseurl to all templates if it isn't set + $vars = array_merge(['$baseurl' => $a->getBaseURL()], $vars); + $t = self::getTemplateEngine(); try {