Removed broken wildcard-support in fromversions
authorMarcel Werk <burntime@woltlab.com>
Fri, 15 Jul 2016 14:28:54 +0000 (16:28 +0200)
committerMarcel Werk <burntime@woltlab.com>
Fri, 15 Jul 2016 14:28:54 +0000 (16:28 +0200)
wcfsetup/install/files/lib/data/package/Package.class.php

index 31bf7b21e237efe47e9e786ed5370fe4a0d7a353..c4eea656da2d344721e54b9932f5836f65527df0 100644 (file)
@@ -282,30 +282,13 @@ class Package extends DatabaseObject {
         * Checks the version number of the installed package against the "fromversion"
         * number of the update.
         * 
-        * The "fromversion" number may contain wildcards (asterisks) which means
-        * that the update covers the whole range of release numbers where the asterisk
-        * wildcards digits from 0 to 9.
-        * For example, if "fromversion" is "1.1.*" and this package updates to
-        * version 1.2.0, all releases from 1.1.0 to 1.1.9 may be updated using
-        * this package.
-        * 
         * @param       string          $currentVersion
         * @param       string          $fromVersion
         * @return      boolean
         */
        public static function checkFromversion($currentVersion, $fromVersion) {
-               if (mb_strpos($fromVersion, '*') !== false) {
-                       // from version with wildcard
-                       // use regular expression
-                       $fromVersion = str_replace('\*', '.*', preg_quote($fromVersion, '!'));
-                       if (preg_match('!^'.$fromVersion.'$!i', $currentVersion)) {
-                               return true;
-                       }
-               }
-               else {
-                       if (self::compareVersion($currentVersion, $fromVersion, '=')) {
-                               return true;
-                       }
+               if (self::compareVersion($currentVersion, $fromVersion, '=')) {
+                       return true;
                }
                
                return false;