Parcourir la source

allow dots in package names (closes #53)

Igor Wiedler il y a 13 ans
Parent
commit
091685f7bf
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      src/Packagist/WebBundle/Entity/Package.php

+ 2 - 2
src/Packagist/WebBundle/Entity/Package.php

@@ -136,8 +136,8 @@ class Package
                 return;
             }
 
-            if (!preg_match('{^[a-z0-9_-]+/[a-z0-9_-]+$}i', $information['name'])) {
-                $context->addViolation('The package name '.$information['name'].' is invalid, it should have a vendor name, a forward slash, and a package name, matching <em>[a-z0-9_-]+/[a-z0-9_-]+</em>.', array(), null);
+            if (!preg_match('{^[a-z0-9_.-]+/[a-z0-9_.-]+$}i', $information['name'])) {
+                $context->addViolation('The package name '.$information['name'].' is invalid, it should have a vendor name, a forward slash, and a package name, matching <em>[a-z0-9_.-]+/[a-z0-9_.-]+</em>.', array(), null);
                 return;
             }
         } catch (\UnexpectedValueException $e) {