Commits

christiansalazar  committed 9915e9a

pattern validator ensure / terminators /

  • Participants
  • Parent commits a54b769

Comments (0)

Files changed (1)

File EYuiForm.php

 			);
 		// regexp validation
 		if($field->field->pattern != ''){
-			Yii::log(__METHOD__." {$field->id} pattern: ".$field->field->pattern,"info");
-			if(!preg_match($field->field->pattern,$newFieldValue))
+			Yii::log(__METHOD__."\n field: {$field->id}\noriginal provided pattern:\n".$field->field->pattern,"info");
+			$securePattern = "/".trim($field->field->pattern,'/')."/";
+			Yii::log(__METHOD__."\n field: {$field->id}\nsecure pattern:\n".$securePattern,"info");
+			if(!preg_match($securePattern,$newFieldValue))
 				if($newFieldValue != '')
 					return array(
 						'result'=>false,