Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Won't Fix
-
Labels:None
Description
I just noticed that we have an issue in our metadata loading in case a document name is prefixed with a backslash when calling find
// fails
$dm->find('\Foo\Bar', $path);
// works
$dm->find('Foo\Bar', $path);
Should the first work as well?
I have traced the issue to the DriverChain
public function loadMetadataForClass($className, ClassMetadata $class)
{
foreach ($this->drivers as $namespace => $driver) {
if (strpos($className, $namespace) === 0)
}
throw MappingException::classIsNotAValidDocument($className);
}
notice the strpos() does not bother to check if a preceding backslash is in the $className var.
the ORM doesn't handle this either