static function fromId($id, $ns, $language=null)
{
+ if (is_null($language)) {
+ $language = common_language();
+ }
+
$location = null;
// Let a third-party handle it
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;
}
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;
}
}