aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2013-06-21 08:53:23 +0200
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2013-06-21 08:53:23 +0200
commit45df26536d6d3fe67d31199b924f185ee4aa47fb (patch)
treec4a94b8b02132fa9341e495845e15153a827b1b1
parent00186b0d0963b490d35c5458456a4ab7b34e1b29 (diff)
downloadRouter-45df26536d6d3fe67d31199b924f185ee4aa47fb.zip
Router-45df26536d6d3fe67d31199b924f185ee4aa47fb.tar.gz
Router-45df26536d6d3fe67d31199b924f185ee4aa47fb.tar.bz2
Fix a bug with auto-prefix on Windows.
On Unix, dirname('/x') returns /. But on Windows, it returns \. This causes a very stupid bug which did not appear with /x/y because on Windows returns, it returns /x. Yes. Thanks @thehawk and @mathias-strasser!
-rw-r--r--Http.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/Http.php b/Http.php
index 435defe..1ce8c31 100644
--- a/Http.php
+++ b/Http.php
@@ -156,7 +156,9 @@ class Http extends Generic implements \Hoa\Core\Parameter\Parameterizable {
$this->_parameters->setParameters($parameters);
if(null === $prefix = $this->_parameters->getParameter('prefix'))
- $this->setPrefix(dirname($this->getBootstrap()));
+ $this->setPrefix(
+ ('\\' === $_ = dirname($this->getBootstrap())) ? '/' : $_
+ );
else
$this->setPrefix($prefix);