Changeset 718 for trunk/lib/Utilities.inc.php
- Timestamp:
- Feb 17, 2020 11:01:55 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Utilities.inc.php
r715 r718 677 677 $val = trim(ini_get($val)); 678 678 if ($val != '') { 679 $ last = strtolower($val{strlen($val) - 1});680 } else {681 $last = ''; 682 }683 switch ($last) {684 // The 'G' modifier is available since PHP 5.1.0685 case 'g':686 $val *= 1024;687 case 'm':688 $val *= 1024;689 case 'k':690 $val *= 1024;679 $unit = strtolower($val{strlen($val) - 1}); 680 $val = preg_replace('/\D/', '', $val); 681 682 switch ($unit) { 683 // No `break`, so these multiplications are cumulative. 684 case 'g': 685 $val *= 1024; 686 case 'm': 687 $val *= 1024; 688 case 'k': 689 $val *= 1024; 690 } 691 691 } 692 692 … … 1063 1063 $app =& App::getInstance(); 1064 1064 1065 if ('POST' == getenv('REQUEST_METHOD') && null === $key) { 1066 return dispelMagicQuotes($_POST, $app->getParam('always_dispel_magicquotes')); 1067 } else if ('GET' == getenv('REQUEST_METHOD') && null === $key) { 1068 return dispelMagicQuotes($_GET, $app->getParam('always_dispel_magicquotes')); 1065 if (null === $key) { 1066 // Return entire array. 1067 switch (strtoupper(getenv('REQUEST_METHOD'))) { 1068 case 'POST': 1069 return dispelMagicQuotes($_POST, $app->getParam('always_dispel_magicquotes')); 1070 1071 case 'GET': 1072 return dispelMagicQuotes($_GET, $app->getParam('always_dispel_magicquotes')); 1073 1074 default: 1075 return dispelMagicQuotes($_REQUEST, $app->getParam('always_dispel_magicquotes')); 1076 } 1069 1077 } 1070 1078 … … 1139 1147 break; 1140 1148 } 1149 1150 $_REQUEST[$key] = $val; 1141 1151 } 1142 1152
Note: See TracChangeset
for help on using the changeset viewer.