]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
fix caching in location.php
authorEvan Prodromou <evan@status.net>
Thu, 29 Oct 2009 20:15:49 +0000 (16:15 -0400)
committerEvan Prodromou <evan@status.net>
Thu, 29 Oct 2009 20:15:49 +0000 (16:15 -0400)
lib/location.php

index c9411b55df5ebff2916caf3676768b85418c4835..bbfc15a36d3929e817df561a05a59683593961b3 100644 (file)
@@ -91,6 +91,10 @@ class Location
 
     static function fromId($id, $ns, $language=null)
     {
+        if (is_null($language)) {
+            $language = common_language();
+        }
+
         $location = null;
 
         // Let a third-party handle it
@@ -167,9 +171,9 @@ class Location
 
     function getURL()
     {
-        if ($this->_url == false) { // cached failure
-            return null;
-        } else if (is_string($this->_url)) { // cached value
+        // Keep one cached
+
+        if (is_string($this->_url)) {
             return $this->_url;
         }
 
@@ -177,14 +181,8 @@ class Location
 
         Event::handle('LocationUrl', array($this, &$url));
 
-        // Save it for later
-
-        if (is_null($url)) {
-            $this->_url = false;
-        } else {
-            $this->_url = $url;
-        }
+        $this->_url = $url;
 
-        return $this->_url;
+        return $url;
     }
 }