Skip to content
Browse files

Fixed for compatibility with php 5.3

  • Loading branch information...
1 parent e72f257 commit 960220ccab63bb53c790d7cd4687d5046815cf0e @mikeho mikeho committed Feb 23, 2010
Showing with 5 additions and 2 deletions.
  1. +5 −2 includes/qcodo/qform/EmailTextBox.class.php
View
7 includes/qcodo/qform/EmailTextBox.class.php
@@ -8,9 +8,12 @@ class EmailTextBox extends QTextBox {
//////////
public function Validate() {
if (parent::Validate()) {
- if ($this->strText != "") {
+ if (strlen(trim($this->strText))) {
// RegExp taken from php.net
- if ( !eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*"."@([a-z0-9]+([\.-][a-z0-9]{1,})+)*$", $this->strText) ) {
+ $this->strText = trim($this->strText);
+ $strEmailAddressArray = QEmailServer::GetEmailAddresses($this->strText);
+ if ((count($strEmailAddressArray) != 1) ||
+ (strtolower($strEmailAddressArray[0]) != strtolower($this->strText))) {
$this->strValidationError = "Invalid e-mail address";
return false;
}

0 comments on commit 960220c

Please sign in to comment.
Something went wrong with that request. Please try again.