No spaces after (casts)
[lhc/web/wiklou.git] / includes / GlobalFunctions.php
index be4ec3e..3e7448d 100644 (file)
@@ -3156,9 +3156,9 @@ function wfBaseConvert( $input, $sourceBase, $destBase, $pad = 1, $lowercase = t
                $sourceBase > 36 ||
                $destBase < 2 ||
                $destBase > 36 ||
-               $sourceBase != (int) $sourceBase ||
-               $destBase != (int) $destBase ||
-               $pad != (int) $pad ||
+               $sourceBase != (int)$sourceBase ||
+               $destBase != (int)$destBase ||
+               $pad != (int)$pad ||
                !preg_match( "/^[" . substr( '0123456789abcdefghijklmnopqrstuvwxyz', 0, $sourceBase ) . "]+$/i", $input )
        ) {
                return false;
@@ -3212,7 +3212,7 @@ function wfBaseConvert( $input, $sourceBase, $destBase, $pad = 1, $lowercase = t
                                $work += $digit;
 
                                if ( $workDigits || $work >= $destBase ) {
-                                       $workDigits[] = (int) ( $work / $destBase );
+                                       $workDigits[] = (int)( $work / $destBase );
                                }
                                $work %= $destBase;
                        }
@@ -3967,3 +3967,16 @@ function wfIsBadImage( $name, $contextTitle = false, $blacklist = null ) {
        wfProfileOut( __METHOD__ );
        return $bad;
 }
+
+/**
+ * Determine whether the client at a given source IP is likely to be able to
+ * access the wiki via HTTPS.
+ *
+ * @param string $ip The IPv4/6 address in the normal human-readable form
+ * @return boolean
+ */
+function wfCanIPUseHTTPS( $ip ) {
+       $canDo = true;
+       wfRunHooks( 'CanIPUseHTTPS', array( $ip, &$canDo ) );
+       return !!$canDo;
+}