Commit f6432fdf authored by mmn's avatar mmn

File_thumbnail->getUrl now gives Attachment_thumbnail action URL

That in turn redirects to the statically stored file.
parent 4fc4f91b
......@@ -62,6 +62,6 @@ class Attachment_thumbnailAction extends AttachmentAction
common_redirect($e->file->getUrl());
}
common_redirect($thumbnail->getUrl());
common_redirect(File_thumbnail::url($thumbnail->filename));
}
}
......@@ -142,7 +142,11 @@ class File_thumbnail extends Managed_DataObject
$this->url = null;
$this->update($orig);
}
return self::url($this->filename);
$url = common_local_url('attachment_thumbnail', array('attachment'=>$this->file_id));
if (strpos($url, '?') === false) {
$url .= '?';
}
return $url . http_build_query(array('w'=>$this->width, 'h'=>$this->height));
}
// No local filename available, return the URL we have stored
......
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