Browse Source

Do not suggest broken require lines, fixes #430

Jordi Boggiano 10 years ago
parent
commit
0801a51fe1
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/Packagist/WebBundle/Entity/Version.php

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

@@ -389,7 +389,7 @@ class Version
      */
     public function getRequireVersion()
     {
-        return str_replace('.x-dev', '.*@dev', $this->getVersion());
+        return preg_replace('{^v(\d)}', '$1', str_replace('.x-dev', '.*@dev', $this->getVersion()));
     }
 
     /**
@@ -916,4 +916,4 @@ class Version
     {
         return $this->name.' '.$this->version.' ('.$this->normalizedVersion.')';
     }
-}
+}