We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 3119341a authored by mattl's avatar mattl

Prefer local URLs for all locally generated notices.

parent 99b1a6f5
......@@ -284,11 +284,11 @@ class Notice extends Managed_DataObject
switch (true) {
case common_valid_http_url($this->url): // should we allow non-http/https URLs?
return $this->url;
case !$this->isLocal() && common_valid_http_url($this->uri): // Sometimes we only have the URI for remote posts.
return $this->uri;
case $this->isLocal():
// let's generate a valid link to our locally available notice on demand
return common_local_url('shownotice', array('notice' => $this->id), null, null, false);
case common_valid_http_url($this->uri):
return $this->uri;
common_debug('No URL available for notice: id='.$this->id);
throw new InvalidUrlException($this->url);
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