Skip to content
Browse files

Robustness in function with empty input

  • Loading branch information...
1 parent 0df93ed commit c69232269c7a65ba39cc31bf9fdbc5692cb53228 moodler committed Nov 23, 2004
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/moodlelib.php
View
3 lib/moodlelib.php
@@ -3411,6 +3411,9 @@ function raise_memory_limit ($newlimit) {
*/
function return_bytes($val) {
$val = trim($val);
+ if (empty($val)) {
+ return '';
+ }
$last = $val{strlen($val)-1};
switch($last) {
case 'k':

0 comments on commit c692322

Please sign in to comment.
Something went wrong with that request. Please try again.