Welcome to Geeklog, Anonymous Monday, December 23 2024 @ 05:11 am EST

Geeklog Forums

Bug in COM_isEmail


Status: offline

THEMike

Forum User
Moderator
Registered: 07/25/03
Posts: 141
Location:Sheffield, UK
COM_isEmail ignores your pear settings:

function COM_isEmail( $email )
{
require_once( 'Mail/RFC822.php' );

$rfc822 = new Mail_RFC822;

return( $rfc822->isValidInetAddress( $email ) ? true : false );
}

So if you don't have Mail/RFC822.php in your include path then it won't work, this works for me:

function COM_isEmail( $email )
{
global $_CONF;
require_once( $_CONF['path_pear'].'Mail/RFC822.php' );

$rfc822 = new Mail_RFC822;

return( $rfc822->isValidInetAddress( $email ) ? true : false );
}

Of course it probably should be wrapped with an if statement checking for $_CONF['have_pear'], not sure if there are other problems elsewhere.

Odd, because I HAVE pear::db available on my path but not the mail stuff...
 Quote

All times are EST. The time is now 05:11 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content