]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
ease up on the validation
authorEvan Prodromou <evan@prodromou.name>
Tue, 20 May 2008 21:01:19 +0000 (17:01 -0400)
committerEvan Prodromou <evan@prodromou.name>
Tue, 20 May 2008 21:01:19 +0000 (17:01 -0400)
darcs-hash:20080520210119-84dde-a9b74a933bd45b2e6b2f96a53a1be55caa0f7912.gz

classes/Notice.php
classes/Profile.php

index f742d4326684cf0860b2cfebd0194bf0463fb70b..eb08dde5226518b9d11b2e7ed1183c92dc49620f 100644 (file)
@@ -50,9 +50,4 @@ class Notice extends DB_DataObject
        function validateContent() {
                return Validate::string($this->content, array('min_length' => 1, 'max_length' => 140));
        }
-
-       function validateUrl() {
-               return is_null($this->url) || (strlen($this->url) == 0) ||
-                 Validate::uri($this->url, array('allowed_schemes' => array('http', 'https')));
-       }
 }
index 650b442442a98ffce1e746a2791689d47370ccdb..d91bcf3ed3b5d43d817138530e4c12c1e8e285a9 100644 (file)
@@ -83,22 +83,19 @@ class Profile extends DB_DataObject
        }
 
        function validateHomepage() {
-               return (is_null($this->homepage) ||
-                               Validate::uri($this->homepage, array('allowed_schemes' => array('http', 'https'))));
+               return (strlen($this->homepage) == 0) ||
+                 Validate::uri($this->homepage, array('allowed_schemes' => array('http', 'https'))));
        }
 
        function validateBio() {
-               return is_null($this->bio) ||
-                 Validate::string($this->bio, array('min_length' => 1, 'max_length' => 140));
+               return Validate::string($this->bio, array('min_length' => 0, 'max_length' => 140));
        }
 
        function validateLocation() {
-               return is_null($this->location) ||
-                 Validate::string($this->location, array('min_length' => 1, 'max_length' => 255));
+               return Validate::string($this->location, array('min_length' => 0, 'max_length' => 255));
        }
 
        function validateFullname() {
-               return is_null($this->fullname) ||
-                 Validate::string($this->fullname, array('min_length' => 1, 'max_length' => 255));
+               return Validate::string($this->fullname, array('min_length' => 0, 'max_length' => 255));
        }
 }