From: Platonides Date: Tue, 25 Jan 2011 22:42:53 +0000 (+0000) Subject: The function wfShorthandToInteger() is precisely for that. X-Git-Tag: 1.31.0-rc.0~32357 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=c0329c3e390bd73218993881f99ea451fc9a6d34;p=lhc%2Fweb%2Fwiklou.git The function wfShorthandToInteger() is precisely for that. The previous way only worked for megabytes, which made it 'raise' the memory limit from several gigabytes to 50M --- diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index c33606c466..507ba2ebc6 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -748,11 +748,7 @@ abstract class Installer { return true; } - $n = intval( $limit ); - - if( preg_match( '/^([0-9]+)[Mm]$/', trim( $limit ), $m ) ) { - $n = intval( $m[1] * ( 1024 * 1024 ) ); - } + $n = wfShorthandToInteger( $limit ); if( $n < $this->minMemorySize * 1024 * 1024 ) { $newLimit = "{$this->minMemorySize}M";