X-Git-Url: http://git.cyclocoop.org/%28?a=blobdiff_plain;f=includes%2FGlobalFunctions.php;h=125b917caad71ec305b2433918778ed8a90c1a07;hb=66eb92b458b4b43f0ca0970d7bbc440f9252e401;hp=3b4e657f75ea4a5c1c7995ab3626578306514c0a;hpb=260a734173bcc6b414aafb92de559505fe47bafc;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 3b4e657f75..125b917caa 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -518,7 +518,7 @@ function wfExpandUrl( $url, $defaultProto = PROTO_CURRENT ) { } } - $defaultProtoWithoutSlashes = substr( $defaultProto, 0, -2 ); + $defaultProtoWithoutSlashes = $defaultProto !== null ? substr( $defaultProto, 0, -2 ) : ''; if ( substr( $url, 0, 2 ) == '//' ) { $url = $defaultProtoWithoutSlashes . $url; @@ -2031,7 +2031,7 @@ function wfRecursiveRemoveDir( $dir ) { */ function wfPercent( $nr, $acc = 2, $round = true ) { $ret = sprintf( "%.${acc}f", $nr ); - return $round ? round( $ret, $acc ) . '%' : "$ret%"; + return $round ? round( (float)$ret, $acc ) . '%' : "$ret%"; } /** @@ -2794,7 +2794,7 @@ function wfMemoryLimit( $newLimit ) { function wfTransactionalTimeLimit() { global $wgTransactionalTimeLimit; - $timeLimit = ini_get( 'max_execution_time' ); + $timeLimit = (int)ini_get( 'max_execution_time' ); // Note that CLI scripts use 0 if ( $timeLimit > 0 && $wgTransactionalTimeLimit > $timeLimit ) { set_time_limit( $wgTransactionalTimeLimit );