summaryrefslogtreecommitdiff
path: root/lib/location.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-10-29 16:15:49 -0400
committerEvan Prodromou <evan@status.net>2009-10-29 16:15:49 -0400
commit5b0809f4a3619e8123b486f7e910913dc4e10086 (patch)
tree9e782e63db164de061364a17ea6ad51982e11f10 /lib/location.php
parent62ba14f5cf54235a0929d2ab06b62bad02ff7241 (diff)
fix caching in location.php
Diffstat (limited to 'lib/location.php')
-rw-r--r--lib/location.php20
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/location.php b/lib/location.php
index c9411b55d..bbfc15a36 100644
--- a/lib/location.php
+++ b/lib/location.php
@@ -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;
}
}