diff --git a/src/Lookup.php b/src/Lookup.php index 74370f8..98a8fe3 100644 --- a/src/Lookup.php +++ b/src/Lookup.php @@ -213,7 +213,7 @@ public function setUpgraderMap($map) */ public function sanitiseNamespaces($class) { - return str_replace('\\', '.', ltrim($class, '\\')); + return preg_replace("/(\\\\+)/", '.', ltrim($class, '\\')); } /** diff --git a/tests/LookupTest.php b/tests/LookupTest.php index 3a658b7..43f667c 100644 --- a/tests/LookupTest.php +++ b/tests/LookupTest.php @@ -73,6 +73,10 @@ public function handleProvider() array('q' => '\Already\Fully\Qualified', 'version' => '3.4'), 'http://mockserver/3.4/class-Already.Fully.Qualified.html' ), + array( + array('q' => '\\\\Already\\\\Fully\\\\Qualified', 'version' => '3.4'), + 'http://mockserver/3.4/class-Already.Fully.Qualified.html' + ), array( array('q' => 'Director', 'module' => 'framework'), 'http://mockserver/master/class-SilverStripe.Control.Director.html'