Navigation Menu

Skip to content

Commit

Permalink
GenericLoader slash appender now handles correctly empty paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
zyxist committed Feb 1, 2011
1 parent 28a097c commit 6370053
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Opl/Autoloader/GenericLoader.php
Expand Up @@ -58,7 +58,8 @@ public function __construct($namespaceSeparator = '\\', $defaultPath = './')
{
$this->_namespaceSeparator = $namespaceSeparator;

if($defaultPath[strlen($defaultPath) - 1] != '/')
$length = strlen($defaultPath);
if($length == 0 || $defaultPath[$length - 1] != '/')
{
$defaultPath .= '/';
}
Expand All @@ -80,7 +81,8 @@ public function addLibrary($library, $path = null, $extension = '.php')
}
if($path !== null)
{
if($path[strlen($path) - 1] != '/')
$length = strlen($path);
if($length == 0 || $path[$length - 1] != '/')
{
$path .= '/';
}
Expand Down

0 comments on commit 6370053

Please sign in to comment.