Ignore:
Timestamp:
Jun 27, 2012, 11:10:50 PM (12 years ago)
Author:
mistic100
Message:

delete subscriptions on image/category deletion
check if is_valid_email() don't exist yet

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Subscribe_to_comments/include/functions.inc.php

    r15656 r16105  
    690690 * @return: bool
    691691 */
    692 function is_valid_email($mail_address)
    693 {
    694   if (version_compare(PHP_VERSION, '5.2.0') >= 0)
    695   {
    696     return filter_var($mail_address, FILTER_VALIDATE_EMAIL)!==false;
    697   }
    698   else
    699   {
    700     $atom   = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]';   // before  arobase
    701     $domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; // domain name
    702     $regex = '/^' . $atom . '+' . '(\.' . $atom . '+)*' . '@' . '(' . $domain . '{1,63}\.)+' . $domain . '{2,63}$/i';
    703 
    704     if (!preg_match($regex, $mail_address)) return false;
    705     return true;
     692if (!function_exists('is_valid_email'))
     693{
     694  function is_valid_email($mail_address)
     695  {
     696    if (version_compare(PHP_VERSION, '5.2.0') >= 0)
     697    {
     698      return filter_var($mail_address, FILTER_VALIDATE_EMAIL)!==false;
     699    }
     700    else
     701    {
     702      $atom   = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]';   // before  arobase
     703      $domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; // domain name
     704      $regex = '/^' . $atom . '+' . '(\.' . $atom . '+)*' . '@' . '(' . $domain . '{1,63}\.)+' . $domain . '{2,63}$/i';
     705
     706      if (!preg_match($regex, $mail_address)) return false;
     707      return true;
     708    }
    706709  }
    707710}
Note: See TracChangeset for help on using the changeset viewer.