From 87700514408d04332527b223a229f9aa8e0f02ed Mon Sep 17 00:00:00 2001 From: Sebastian Stumpf Date: Mon, 5 Oct 2015 13:59:39 +0200 Subject: [PATCH] Fix: Themes were not applied to modules on Windows Systems. --- protected/humhub/components/Theme.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/protected/humhub/components/Theme.php b/protected/humhub/components/Theme.php index 87d10470b3..2f603d3369 100644 --- a/protected/humhub/components/Theme.php +++ b/protected/humhub/components/Theme.php @@ -92,13 +92,15 @@ class Theme extends \yii\base\Theme */ protected function autoFindModuleView($path) { + $sep = preg_quote(DIRECTORY_SEPARATOR); + // .../moduleId/views/controllerId/viewName.php - if (preg_match('@.*/(.*?)/views/(.*?)/(.*?)\.php$@', $path, $hits)) { + if (preg_match('@.*'.$sep.'(.*?)'.$sep.'views'.$sep.'(.*?)'.$sep.'(.*?)\.php$@', $path, $hits)) { return $this->getBasePath() . '/views/' . $hits[1] . '/' . $hits[2] . '/' . $hits[3] . '.php'; } // /moduleId/[widgets|activities|notifications]/views/viewName.php - if (preg_match('@.*/(.*?)/(widgets|notifications|activities)/views/(.*?)\.php$@', $path, $hits)) { + if (preg_match('@.*'.$sep.'(.*?)'.$sep.'(widgets|notifications|activities)'.$sep.'views'.$sep.'(.*?)\.php$@', $path, $hits)) { return $this->getBasePath() . '/views/' . $hits[1] . '/' . $hits[2] . '/' . $hits[3] . '.php'; }