Remove get_ico page

It's no longer needed because ICO now uses Image->get_image_link()
This commit is contained in:
im-mi 2016-09-26 11:15:08 -04:00
parent e6dd1b492c
commit 8805f0dd18
3 changed files with 1 additions and 15 deletions

View File

@ -53,6 +53,7 @@ AddType audio/ogg oga ogg opus
AddType image/jpeg jpg jpeg AddType image/jpeg jpg jpeg
AddType image/bmp bmp AddType image/bmp bmp
AddType image/svg+xml svg svgz AddType image/svg+xml svg svgz
AddType image/x-icon ico ani cur
AddType image/webp webp AddType image/webp webp
AddType video/mp4 f4v f4p m4v mp4 AddType video/mp4 f4v f4p m4v mp4
AddType video/ogg ogv AddType video/ogg ogv

View File

@ -35,20 +35,6 @@ class IcoFileHandler extends Extension {
} }
} }
public function onPageRequest(PageRequestEvent $event) {
global $page;
if($event->page_matches("get_ico")) {
$id = int_escape($event->get_arg(0));
$image = Image::by_id($id);
$hash = $image->hash;
$ha = substr($hash, 0, 2);
$page->set_type("image/x-icon");
$page->set_mode("data");
$page->set_data(file_get_contents("images/$ha/$hash"));
}
}
/** /**
* @param string $ext * @param string $ext
* @return bool * @return bool

View File

@ -4,7 +4,6 @@ class IcoHandlerTest extends ShimmiePHPUnitTestCase {
$this->log_in_as_user(); $this->log_in_as_user();
$image_id = $this->post_image("lib/static/favicon.ico", "shimmie favicon"); $image_id = $this->post_image("lib/static/favicon.ico", "shimmie favicon");
$this->get_page("post/view/$image_id"); // test for no crash $this->get_page("post/view/$image_id"); // test for no crash
$this->get_page("get_ico/$image_id"); // test for no crash
# FIXME: test that the thumb works # FIXME: test that the thumb works
# FIXME: test that it gets displayed properly # FIXME: test that it gets displayed properly