Validator_helper - A bug in is_safe_character function

edited July 2012 in Bug Reports
Hi,

If I am using the is_safe_character function with a value that has only '_-' in it, the function returns FALSE.

I have changed the if statement in the function to check if the newVal is empty as well, and that solved the problem.
function is_safe_character($val, $allowed= array('_', '-')) { $newVal = str_replace($allowed, '', $val); if(ctype_alnum($newVal) || empty($newVal)) { return TRUE; } return FALSE; }

Comments

  • edited 11:30AM
    Thanks for the report. We'll roll it into the 1.0 branch.
Sign In or Register to comment.