summaryrefslogtreecommitdiff
path: root/includes/GlobalFunctions.php
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-05-01 15:31:33 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-05-01 15:31:33 -0400
commit150f94f051128f367bc89f6b7e5f57eb2a69fc62 (patch)
tree181f454813b310ee97385058c6c6f2e3f34d5fd8 /includes/GlobalFunctions.php
parent7e85254903c7c0cb49e381f16b18441ea7b058cc (diff)
parent80f7dc77d430774192b929d780f96260066df2ee (diff)
Merge commit '80f7dc'
# Conflicts: # extensions/ArchInterWiki.sql
Diffstat (limited to 'includes/GlobalFunctions.php')
-rw-r--r--includes/GlobalFunctions.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index 45cd7ea5..ab3f019f 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -3860,12 +3860,13 @@ function wfMemoryLimit() {
* Converts shorthand byte notation to integer form
*
* @param string $string
+ * @param int $default Returned if $string is empty
* @return int
*/
-function wfShorthandToInteger( $string = '' ) {
+function wfShorthandToInteger( $string = '', $default = -1 ) {
$string = trim( $string );
if ( $string === '' ) {
- return -1;
+ return $default;
}
$last = $string[strlen( $string ) - 1];
$val = intval( $string );