Permalink
Browse files

Made clean_param() supports recursive cleanup of arrays

  • Loading branch information...
1 parent 56eb871 commit 80bfd470248505de08bb8f86fb688b818aeb7f08 patrickslee committed Oct 12, 2005
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/moodlelib.php
View
@@ -298,6 +298,14 @@ function clean_param($param, $options) {
global $CFG;
+ if (is_array($param)) { // Let's loop
+ $newparam = array();
+ foreach ($param as $key => $value) {
+ $newparam[$key] = clean_param($value, $options);
+ }
+ return $newparam;
+ }
+
if (!$options) {
return $param; // Return raw value
}

0 comments on commit 80bfd47

Please sign in to comment.