aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrion Vibber <brion@users.mediawiki.org>2005-07-16 06:31:46 +0000
committerBrion Vibber <brion@users.mediawiki.org>2005-07-16 06:31:46 +0000
commitfc4eb0ad568d4d8611b7453de2487de3b39c3c03 (patch)
treef973014eed54836eba300546a36848a3ea782422
parenta29a30b15ebd709b040e79fcaa5b80a39401c0a1 (diff)
downloadmediawikicore-fc4eb0ad568d4d8611b7453de2487de3b39c3c03.tar.gz
mediawikicore-fc4eb0ad568d4d8611b7453de2487de3b39c3c03.zip
* PHP 4.1.2 compatibility fix: define floatval() equivalent if missing
This triggered if the 'days' option in Special:Watchlist was selected
Notes
Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/10152
-rw-r--r--RELEASE-NOTES1
-rw-r--r--includes/GlobalFunctions.php11
2 files changed, 12 insertions, 0 deletions
diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index 5147e1b35979..f94aecf1d881 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 939c9ea3dfcb..07e7750c0d62 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