Replace get{Local,Full,Link,Canonical}URL's $variant argument with a secondary $query...
[lhc/web/wiklou.git] / includes / IP.php
index 2f262e3..e3f6121 100644 (file)
@@ -18,7 +18,7 @@
  * http://www.gnu.org/copyleft/gpl.html
  *
  * @file
- * @author Ashar Voultoiz <hashar at free dot fr>, Aaron Schulz
+ * @author Antoine Musso <hashar at free dot fr>, Aaron Schulz
  */
 
 // Some regex definition to "play" with IP address and IP address blocks
@@ -707,11 +707,11 @@ class IP {
         */
        public static function sanitizeRange( $range ) {
                list( /*...*/, $bits ) = self::parseCIDR( $range );
-               if ( $bits === false ) {
-                       return $range; // wasn't actually a range
-               }
                list( $start, /*...*/ ) = self::parseRange( $range );
                $start = self::formatHex( $start );
+               if ( $bits === false ) {
+                       return $start; // wasn't actually a range
+               }
                return "$start/$bits";
        }
 }