Merge pull request #302 from roadster31/getbaseurlfix

Fixes PHP Warning:  strpos(): Empty needle
This commit is contained in:
Manuel Raynaud
2014-04-17 00:41:13 +02:00

View File

@@ -141,7 +141,9 @@ class URL
// As base URL also contains /thelia2 (e.g. http://some.server.com/thelia2), we end up with
// http://some.server.com/thelia2/thelia2/my/path, instead of http://some.server.com/thelia2/my/path
// We have to compensate for this.
$hasSubdirectory = 0 === strpos($path, $this->requestContext->getBaseUrl());
$rcbu = $this->requestContext->getBaseUrl();
$hasSubdirectory = ! empty($rcbu) && (0 === strpos($path, $rcbu));
$base_url = $this->getBaseUrl($hasSubdirectory);