vernes / YiiMailer

Yii extension for sending emails with layouts using PHPMailer
81 stars 38 forks source link

Setter validation #2

Closed ghost closed 10 years ago

ghost commented 11 years ago

Condition: !is_string($path) && !preg_match("/[a-z0-9.]/i",$path) Second part never be fulfilled, because if variable is not string, what will work with a regular expression.

May be better set "||" instead of "&&"?

vernes commented 10 years ago

Well, $path must be string AND only some character are allowed. I could write it also as: !(is_string($path) || preg_match("/[a-z0-9.]/i",$path))