MDL-26234 fix fatal user upload error when custom text area field present
authorPetr Skoda <commits@skodak.org>
Sun, 6 Feb 2011 19:57:21 +0000 (20:57 +0100)
committerPetr Skoda <commits@skodak.org>
Sun, 6 Feb 2011 19:57:21 +0000 (20:57 +0100)
Please note this does not fix problems with the actual upload of custon text area fields.

admin/uploaduser.php

index 605a53d..5ee0e8a 100755 (executable)
@@ -295,7 +295,13 @@ if ($formdata = $mform->is_cancelled()) {
             }
             if (isset($formdata->$field)) {
                 // process templates
-                $user->$field = process_template($formdata->$field, $user);
+                if (is_array($formdata->$field)) {
+                    foreach ($formdata->$field as $k=>$v) {
+                        $user->$field[$k] = process_template($v, $user);
+                    }
+                } else {
+                    $user->$field = process_template($formdata->$field, $user);
+                }
             }
         }