From: Brion Vibber Date: Sat, 16 Jul 2005 06:31:46 +0000 (+0000) Subject: * PHP 4.1.2 compatibility fix: define floatval() equivalent if missing X-Git-Tag: 1.5.0beta4~118 X-Git-Url: https://git.cyclocoop.org/admin/%7B%24plugin.url%7Cescape%7D?a=commitdiff_plain;h=fc4eb0ad568d4d8611b7453de2487de3b39c3c03;p=lhc%2Fweb%2Fwiklou.git * PHP 4.1.2 compatibility fix: define floatval() equivalent if missing This triggered if the 'days' option in Special:Watchlist was selected --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 5147e1b359..f94aecf1d8 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -578,6 +578,7 @@ of MediaWiki:Newpagetext) to &action=edit, if page is new. * Undo inconsistent editing behavior change * (bug 2835) Back out fix for bug 2802, caused regressions in category sort * (bug 2866) Revert experimental, non-cross-platform sortable table hack +* PHP 4.1.2 compatibility fix: define floatval() equivalent if missing === Caveats === diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 939c9ea3df..07e7750c0d 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -79,6 +79,17 @@ if ( !function_exists( 'mb_substr' ) ) { } } +if( !function_exists( 'floatval' ) ) { + /** + * First defined in PHP 4.2.0 + * @param mixed $var; + * @return float + */ + function floatval( $var ) { + return (float)$var; + } +} + /** * Where as we got a random seed * @var bool $wgTotalViews