Commit 0cbc7031 authored by zYne's avatar zYne

Nospace validator fixed

parent 868e0bca
<?php
class Doctrine_Validator_NoSpace {
class Doctrine_Validator_Nospace {
/**
* @param Doctrine_Record $record
* @param string $key
......@@ -8,10 +8,7 @@ class Doctrine_Validator_NoSpace {
* @return boolean
*/
public function validate(Doctrine_Record $record, $key, $value, $args) {
if(trim($value) === '')
return false;
return true;
return ($value === null || ! preg_match('/\s\t\r\n/',$value));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment