*/
public function exists($name)
{
- return $this->doFindTemplate($name);
+ return $this->doFindTemplate($this->normalizeName($name));
}
/**
protected function findTemplate($name)
{
+ $name = $this->normalizeName($name);
+
if ($this->doFindTemplate($name)) {
return $this->cache[$name];
}
protected function doFindTemplate($name)
{
- $name = preg_replace('#/{2,}#', '/', strtr((string) $name, '\\', '/'));
-
$this->validateName($name);
if (isset($this->cache[$name])) {
return false;
}
+ protected function normalizeName($name)
+ {
+ return preg_replace('#/{2,}#', '/', strtr((string) $name, '\\', '/'));
+ }
+
protected function validateName($name)
{
if (false !== strpos($name, "\0")) {