Skip to content

Instantly share code, notes, and snippets.

@co3k
Created June 17, 2010 04:33
Show Gist options
  • Save co3k/441690 to your computer and use it in GitHub Desktop.
Save co3k/441690 to your computer and use it in GitHub Desktop.
diff --git a/lib/vendor/PEAR/PEAR/Common.php b/lib/vendor/PEAR/PEAR/Common.php
index 5276441..1e0a7db 100644
--- a/lib/vendor/PEAR/PEAR/Common.php
+++ b/lib/vendor/PEAR/PEAR/Common.php
@@ -30,7 +30,7 @@ define('_PEAR_COMMON_PACKAGE_NAME_PREG', '[A-Za-z][a-zA-Z0-9_]+');
define('PEAR_COMMON_PACKAGE_NAME_PREG', '/^' . _PEAR_COMMON_PACKAGE_NAME_PREG . '\\z/');
// this should allow: 1, 1.0, 1.0RC1, 1.0dev, 1.0dev123234234234, 1.0a1, 1.0b1, 1.0pl1
-define('_PEAR_COMMON_PACKAGE_VERSION_PREG', '\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?');
+define('_PEAR_COMMON_PACKAGE_VERSION_PREG', '\d+(?:\.\d+)*(?:[a-zA-Z\d]+)?');
define('PEAR_COMMON_PACKAGE_VERSION_PREG', '/^' . _PEAR_COMMON_PACKAGE_VERSION_PREG . '\\z/i');
// XXX far from perfect :-)
@@ -834,4 +834,4 @@ class PEAR_Common extends PEAR
}
require_once 'PEAR/Config.php';
-require_once 'PEAR/PackageFile.php';
\ No newline at end of file
+require_once 'PEAR/PackageFile.php';
diff --git a/lib/vendor/PEAR/PEAR/PackageFile/v2/Validator.php b/lib/vendor/PEAR/PEAR/PackageFile/v2/Validator.php
index 616b7e7..d2ed5da 100644
--- a/lib/vendor/PEAR/PEAR/PackageFile/v2/Validator.php
+++ b/lib/vendor/PEAR/PEAR/PackageFile/v2/Validator.php
@@ -471,11 +471,11 @@ class PEAR_PackageFile_v2_Validator
$a = $this->_stupidSchemaValidate($structure, $this->_packageInfo['version'], '<version>');
$a &= $this->_stupidSchemaValidate($structure, $this->_packageInfo['stability'], '<stability>');
if ($a) {
- if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/',
+ if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z\d]+)?\\z/',
$this->_packageInfo['version']['release'])) {
$this->_invalidVersion('release', $this->_packageInfo['version']['release']);
}
- if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/',
+ if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z\d]+)?\\z/',
$this->_packageInfo['version']['api'])) {
$this->_invalidVersion('api', $this->_packageInfo['version']['api']);
}
@@ -2151,4 +2151,4 @@ class PEAR_PackageFile_v2_Validator
return $providesret;
}
-}
\ No newline at end of file
+}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment