Explorar el Código

Prevent local URIs

Jordi Boggiano hace 12 años
padre
commit
e52a4c9ded
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      src/Packagist/WebBundle/Entity/Package.php

+ 5 - 0
src/Packagist/WebBundle/Entity/Package.php

@@ -288,6 +288,11 @@ class Package
      */
     public function setRepository($repository)
     {
+        // prevent local filesystem URLs
+        if (preg_match('{^(\.|[a-z]:|/)}i', $repository)) {
+            return;
+        }
+
         $this->repository = $repository;
 
         // avoid user@host URLs