Commit 0cbc7031 authored by zYne's avatar zYne

Nospace validator fixed

parent 868e0bca
<?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 { ...@@ -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;
} }
} }
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