r80999 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80998‎ | r80999 | r81000 >
Date:22:42, 25 January 2011
Author:platonides
Status:ok
Tags:
Comment:
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
Modified paths:
  • /trunk/phase3/includes/installer/Installer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/Installer.php
@@ -748,12 +748,8 @@
749749 return true;
750750 }
751751
752 - $n = intval( $limit );
 752+ $n = wfShorthandToInteger( $limit );
753753
754 - if( preg_match( '/^([0-9]+)[Mm]$/', trim( $limit ), $m ) ) {
755 - $n = intval( $m[1] * ( 1024 * 1024 ) );
756 - }
757 -
758754 if( $n < $this->minMemorySize * 1024 * 1024 ) {
759755 $newLimit = "{$this->minMemorySize}M";
760756

Follow-up revisions

RevisionCommit summaryAuthorDate
r814021.17: MFT r79915, r79957, r79964, r79990, r80687, r80999, r81006, r81011, r81...catrope16:18, 2 February 2011

Status & tagging log