diff options
Diffstat (limited to 'it_mail.class')
-rw-r--r-- | it_mail.class | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/it_mail.class b/it_mail.class index 9ab04bd..db3d9ea 100644 --- a/it_mail.class +++ b/it_mail.class @@ -197,7 +197,7 @@ function send() /* Automatically add doctype if none given */ - if ($this->body[IT_MAIL_HTML] && !eregi('^<!doctype', $this->body[IT_MAIL_HTML])) + if ($this->body[IT_MAIL_HTML] && !preg_match('/^<!doctype/i', $this->body[IT_MAIL_HTML])) { $this->body[IT_MAIL_HTML] = '<!doctype html public "-//w3c//dtd html 4.01 transitional//en">' . "\n" . $this->body[IT_MAIL_HTML]; } @@ -344,7 +344,7 @@ function send_smtp_cmd($fp, $cmd, &$answer, $timeoutok = false, $failcode = 300) if (!$cmd || (!feof($fp) && fwrite($fp, "$cmd\r\n"))) { - while (!feof($fp) && ereg('^(...)(.?)(.*)$', fgets($fp, 1024), $regs)) + while (!feof($fp) && preg_match('/^(...)(.?)(.*)[\r\n]*$/', fgets($fp, 1024), $regs)) { $answer .= $regs[0]; $resultcode = intval($regs[1]); @@ -383,7 +383,7 @@ function check_email($email, $checkmailbox = true) $result = IT_MAIL_CHECKEMAIL_INVALID; /* Check if username starts with www. or not well-formed => reject */ - if (!ereg('^www\.', $email) && eregi('^[a-z0-9&_+.-]+@([a-z0-9.-]+\.[a-z]+)$', $email, $regs)) + if (!preg_match('/^www\./', $email) && preg_match('/^[a-z0-9&_+.-]+@([a-z0-9.-]+\.[a-z]+)$/i', $email, $regs)) { $domain = $regs[1]; @@ -423,7 +423,7 @@ function check_email($email, $checkmailbox = true) } } - if (eregi('@([a-z0-9.-]+\.[a-z]+)$', $from, $regs)) + if (preg_match('/@([a-z0-9.-]+\.[a-z]+)$/i', $from, $regs)) $fromdomain = $regs[1]; else $fromdomain = 'gna.ch'; @@ -452,7 +452,7 @@ function check_email($email, $checkmailbox = true) if (it_mail::send_smtp_cmd($fp, "RCPT TO: <$email>", $answer, $timeoutok, 500)) # 450 is often used for Greylisting $result = IT_MAIL_CHECKEMAIL_OK; - else if (eregi('quota|full|exceeded storage', $answer)) + else if (preg_match('/quota|full|exceeded storage/i', $answer)) $result = IT_MAIL_CHECKEMAIL_MAILBOXFULL; /* Do not try other MX if we got this far */ |