Permalink
Browse files

MDL-35489 users: Check added before using form data

  • Loading branch information...
Rajesh Taneja
Rajesh Taneja committed Oct 18, 2012
1 parent 6738413 commit 4e15f69cb1a0e0b438083bc379135d11005631d7
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 4e15f69

Please sign in to comment.