Merge "Make wfForeignMemcKey consistent with wfMemcKey"
[lhc/web/wiklou.git] / includes / IP.php
index 1e0a4f9..0943606 100644 (file)
@@ -492,6 +492,11 @@ class IP {
                        $n = ip2long( $ip );
                        if ( $n < 0 ) {
                                $n += pow( 2, 32 );
+                               # On 32-bit platforms (and on Windows), 2^32 does not fit into an int,
+                               # so $n becomes a float. We convert it to string instead.
+                               if ( is_float ( $n ) ) {
+                                       $n = (string) $n;
+                               }
                        }
                }
                return $n;