From fc4eb0ad568d4d8611b7453de2487de3b39c3c03 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 16 Jul 2005 06:31:46 +0000 Subject: [PATCH] * PHP 4.1.2 compatibility fix: define floatval() equivalent if missing This triggered if the 'days' option in Special:Watchlist was selected --- RELEASE-NOTES | 1 + includes/GlobalFunctions.php | 11 +++++++++++ 2 files changed, 12 insertions(+) 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 -- 2.20.1