Skip to content
Browse files

MDL-35489 users: Check added before using form data

  • Loading branch information...
1 parent ecfe814 commit 5f0ba65f264e6dad6a5a4a6981c02f5ba1d56a37 @rajeshtaneja rajeshtaneja committed Oct 18, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 user/filters/text.php
View
7 user/filters/text.php
@@ -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 5f0ba65

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