Fix css url prefix for IgnoreFrontController enabled configs

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2017-01-05 20:29:03 +01:00 committed by Roeland Jago Douma
parent 8bcad88c6f
commit 7b8c777b57
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 6 additions and 1 deletions

View File

@ -164,7 +164,12 @@ class SCSSCacher {
*/
private function rebaseUrls($css, $webDir) {
$re = '/url\([\'"]([\.\w?=\/-]*)[\'"]\)/x';
$subst = 'url(\'../../../'.$webDir.'/$1\')';
// OC\Route\Router:75
if(($this->systemConfig->getValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true')) {
$subst = 'url(\'../../'.$webDir.'/$1\')';
} else {
$subst = 'url(\'../../../'.$webDir.'/$1\')';
}
return preg_replace($re, $subst, $css);
}