1
0
mirror of synced 2024-12-13 14:56:01 +03:00

Nospace validator fixed

This commit is contained in:
zYne 2006-09-13 18:19:24 +00:00
parent 868e0bcae7
commit 0cbc7031ce

View File

@ -1,5 +1,5 @@
<?php <?php
class Doctrine_Validator_NoSpace { class Doctrine_Validator_Nospace {
/** /**
* @param Doctrine_Record $record * @param Doctrine_Record $record
* @param string $key * @param string $key
@ -8,10 +8,7 @@ class Doctrine_Validator_NoSpace {
* @return boolean * @return boolean
*/ */
public function validate(Doctrine_Record $record, $key, $value, $args) { public function validate(Doctrine_Record $record, $key, $value, $args) {
if(trim($value) === '') return ($value === null || ! preg_match('/\s\t\r\n/',$value));
return false;
return true;
} }
} }