[HttpKernel] fixed a PHP notice

This commit is contained in:
Fabien Potencier 2011-05-03 13:55:00 +02:00
parent 3c2b3f2537
commit 036be03dff

View File

@ -242,8 +242,11 @@ abstract class Kernel implements KernelInterface
throw new \RuntimeException(sprintf('File name "%s" contains invalid characters (..).', $name));
}
$name = substr($name, 1);
list($bundleName, $path) = explode('/', $name, 2);
$bundleName = substr($name, 1);
$path = '';
if (false !== strpos($bundleName, '/')) {
list($bundleName, $path) = explode('/', $bundleName, 2);
}
$isResource = 0 === strpos($path, 'Resources') && null !== $dir;
$overridePath = substr($path, 9);
@ -280,7 +283,7 @@ abstract class Kernel implements KernelInterface
return $first && $isResource ? $files[0] : $files;
}
throw new \InvalidArgumentException(sprintf('Unable to find file "@%s".', $name));
throw new \InvalidArgumentException(sprintf('Unable to find file "%s".', $name));
}
/**