Advertisement
Guest User

Error code

a guest
Nov 17th, 2012
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.11 KB | None | 0 0
  1. Here's the code:
  2. /Profile-Modify.php:
  3.                        // Any masks?
  4.                        if ($row['field_type'] == 'text' && !empty($row['mask']) && $row['mask'] != 'none')
  5.                        {
  6.                                //!!! We never error on this - just ignore it at the moment...
  7.                                if ($row['mask'] == 'email' && (preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', $value) === 0 || strlen($value) > 255))
  8.                                         $value = '';
  9.                                 elseif ($row['mask'] == 'number')
  10.                                 {
  11.                                         $value = (int) $value;
  12.                                 }
  13. 1304>>>                                elseif (substr($row['mask'], 0, 5) == 'regex' && preg_match(substr($row['mask'], 5), $value) === 0)
  14.                                         $value = '';
  15.                         }
  16.                 }
  17.  
  18.  
  19.  
  20. /Register.php:
  21.  
  22.                         // Any masks to apply?
  23.                         if ($row['field_type'] == 'text' && !empty($row['mask']) && $row['mask'] != 'none')
  24.                         {
  25.                                 //!!! We never error on this - just ignore it at the moment...
  26.                                 if ($row['mask'] == 'email' && (preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', $value) === 0 || strlen($value) > 255))
  27.                                         $custom_field_errors[] = array('custom_field_invalid_email', array($row['field_name']));
  28.                                 elseif ($row['mask'] == 'number' && preg_match('~[^\d]~', $value))
  29.                                         $custom_field_errors[] = array('custom_field_not_number', array($row['field_name']));
  30.                                 elseif (substr($row['mask'], 0, 5) == 'regex' && preg_match(substr($row['mask'], 5), $value) === 0)
  31. 437>>>                                        $custom_field_errors[] = array('custom_field_inproper_format', array($row['field_name']));
  32.                         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement