forked from GNUsocial/gnu-social
fix caching in location.php
This commit is contained in:
parent
62ba14f5cf
commit
5b0809f4a3
@ -91,6 +91,10 @@ class Location
|
|||||||
|
|
||||||
static function fromId($id, $ns, $language=null)
|
static function fromId($id, $ns, $language=null)
|
||||||
{
|
{
|
||||||
|
if (is_null($language)) {
|
||||||
|
$language = common_language();
|
||||||
|
}
|
||||||
|
|
||||||
$location = null;
|
$location = null;
|
||||||
|
|
||||||
// Let a third-party handle it
|
// Let a third-party handle it
|
||||||
@ -167,9 +171,9 @@ class Location
|
|||||||
|
|
||||||
function getURL()
|
function getURL()
|
||||||
{
|
{
|
||||||
if ($this->_url == false) { // cached failure
|
// Keep one cached
|
||||||
return null;
|
|
||||||
} else if (is_string($this->_url)) { // cached value
|
if (is_string($this->_url)) {
|
||||||
return $this->_url;
|
return $this->_url;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -177,14 +181,8 @@ class Location
|
|||||||
|
|
||||||
Event::handle('LocationUrl', array($this, &$url));
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user