From 9b374861beea425bec14618696db34745fb66291 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Tue, 10 May 2016 11:15:28 +0900 Subject: [PATCH] Fix #488 extra hyphen when there is no subtitle --- classes/context/Context.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index 0bdd79af4..232f9df3d 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -874,9 +874,9 @@ class Context } if (count($vars)) { - $title = preg_replace_callback('/\\$(\w+)/', function($matches) use($vars) { + $title = trim(trim(preg_replace_callback('/\\$(\w+)/', function($matches) use($vars) { return isset($vars[strtolower($matches[1])]) ? $vars[strtolower($matches[1])] : $matches[0]; - }, $title); + }, $title), ' -')); } self::$_instance->site_title = $title; }