]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
fix validation of url
authorEvan Prodromou <evan@prodromou.name>
Tue, 20 May 2008 19:26:34 +0000 (15:26 -0400)
committerEvan Prodromou <evan@prodromou.name>
Tue, 20 May 2008 19:26:34 +0000 (15:26 -0400)
darcs-hash:20080520192634-84dde-2394dbf8767ff886817a5f20f5c9064ea3a1bc79.gz

classes/Notice.php

index f06b21d6c6e067e8eec09810fb17e3310db0c789..f742d4326684cf0860b2cfebd0194bf0463fb70b 100644 (file)
@@ -43,14 +43,8 @@ class Notice extends DB_DataObject
     /* the code above is auto generated do not remove the tag below */
     ###END_AUTOCODE
 
-       // XXX: if profile_id changes, this goes invalid. To be fair, that's a very edge case
-       static $profile;
-
        function getProfile() {
-               if (!$this->profile) {
-                       $this->profile = Profile::staticGet($this->profile_id);
-               }
-               return $this->profile;
+               return Profile::staticGet($this->profile_id);
        }
 
        function validateContent() {
@@ -58,7 +52,7 @@ class Notice extends DB_DataObject
        }
 
        function validateUrl() {
-               return is_null($this->url) ||
+               return is_null($this->url) || (strlen($this->url) == 0) ||
                  Validate::uri($this->url, array('allowed_schemes' => array('http', 'https')));
        }
 }