Permalink
Browse files

MDL-35489 users: Check added before using form data

  • Loading branch information...
1 parent f4b03cf commit 62e1fab324a2414bcbabf5959534c591bea73091 Rajesh Taneja committed Oct 18, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 user/filters/text.php
View
@@ -62,7 +62,12 @@ function check_data($formdata) {
// no data - no change except for empty filter
return false;
}
- return array('operator'=>(int)$formdata->$operator, 'value'=>$formdata->$field);
+ // If field value is set then use it, else it's null.
+ $fieldvalue = null;
+ if (isset($formdata->$field)) {
+ $fieldvalue = $formdata->$field;
+ }
+ return array('operator' => (int)$formdata->$operator, 'value' => $fieldvalue);
}
return false;

0 comments on commit 62e1fab

Please sign in to comment.