Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Here's the code:
- /Profile-Modify.php:
- // Any masks?
- if ($row['field_type'] == 'text' && !empty($row['mask']) && $row['mask'] != 'none')
- {
- //!!! We never error on this - just ignore it at the moment...
- if ($row['mask'] == 'email' && (preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', $value) === 0 || strlen($value) > 255))
- $value = '';
- elseif ($row['mask'] == 'number')
- {
- $value = (int) $value;
- }
- 1304>>> elseif (substr($row['mask'], 0, 5) == 'regex' && preg_match(substr($row['mask'], 5), $value) === 0)
- $value = '';
- }
- }
- /Register.php:
- // Any masks to apply?
- if ($row['field_type'] == 'text' && !empty($row['mask']) && $row['mask'] != 'none')
- {
- //!!! We never error on this - just ignore it at the moment...
- if ($row['mask'] == 'email' && (preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', $value) === 0 || strlen($value) > 255))
- $custom_field_errors[] = array('custom_field_invalid_email', array($row['field_name']));
- elseif ($row['mask'] == 'number' && preg_match('~[^\d]~', $value))
- $custom_field_errors[] = array('custom_field_not_number', array($row['field_name']));
- elseif (substr($row['mask'], 0, 5) == 'regex' && preg_match(substr($row['mask'], 5), $value) === 0)
- 437>>> $custom_field_errors[] = array('custom_field_inproper_format', array($row['field_name']));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement