Commit 72707ddc authored by mmn's avatar mmn

deprecate Notice::bestUrl() in favor of getUrl()

parent 7ca6597c
......@@ -1697,15 +1697,13 @@ class Notice extends Managed_DataObject
return $noun->asString('activity:' . $element);
}
// FIXME: Replace all bestUrl with getUrl and do exception handling
function bestUrl()
{
if (!empty($this->url)) {
return $this->url;
} else if (!empty($this->uri) && preg_match('/^https?:/', $this->uri)) {
return $this->uri;
} else {
return common_local_url('shownotice',
array('notice' => $this->id));
try {
return $this->getUrl();
} catch (InvalidUrlException $e) {
return common_local_url('shownotice', array('notice' => $this->id));
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment