Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F5080
memory_limit.diff
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Authored By
•
bzimport
Nov 21 2014, 10:18 PM
2014-11-21 22:18:18 (UTC+0)
Size
728 B
Referenced Files
None
Subscribers
None
memory_limit.diff
View Options
Index: includes/GlobalFunctions.php
===================================================================
--- includes/GlobalFunctions.php (revision 54340)
+++ includes/GlobalFunctions.php (working copy)
@@ -3195,11 +3195,17 @@
/* Parse PHP's silly format for memory limits */
function wfParseMemoryLimit( $memlimit ) {
- $n = intval( $memlimit );
- if( preg_match( '/^([0-9]+)[Mm]$/', trim( $memlimit ), $m ) ) {
- $n = intval( $m[1] * (1024*1024) );
+ $last = strtolower($memlimit[strlen($memlimit)-1]);
+ $val = intval( $memlimit );
+ switch($last) {
+ case 'g':
+ $val *= 1024;
+ case 'm':
+ $val *= 1024;
+ case 'k':
+ $val *= 1024;
}
- return $n;
+ return $val;
}
/* Get the normalised IETF language tag
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4643
Default Alt Text
memory_limit.diff (728 B)
Attached To
Mode
T18084: Default memory limit should be increased
Attached
Detach File
Event Timeline
Log In to Comment