1
1
Fork 0

Merge pull request #6953 from tobiasd/20190330-csspath

check if BasePath is empty to prevent mangeled up CSS path
This commit is contained in:
Philipp 2019-03-31 10:12:40 +02:00 committed by GitHub
commit e5cc35cb45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -182,9 +182,11 @@ class App
*/
public function registerStylesheet($path)
{
$url = str_replace($this->getBasePath() . DIRECTORY_SEPARATOR, '', $path);
if (mb_strpos($path, $this->getBasePath() . DIRECTORY_SEPARATOR) == 0) {
$path = mb_substr($path, mb_strlen($this->getBasePath() . DIRECTORY_SEPARATOR));
}
$this->stylesheets[] = trim($url, '/');
$this->stylesheets[] = trim($path, '/');
}
/**