From 8805f0dd182efdb107b1e717a03cb6d2dc04d598 Mon Sep 17 00:00:00 2001 From: im-mi Date: Mon, 26 Sep 2016 11:15:08 -0400 Subject: [PATCH] Remove get_ico page It's no longer needed because ICO now uses Image->get_image_link() --- .htaccess | 1 + ext/handle_ico/main.php | 14 -------------- ext/handle_ico/test.php | 1 - 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/.htaccess b/.htaccess index 8e33b6f3..30a33a42 100644 --- a/.htaccess +++ b/.htaccess @@ -53,6 +53,7 @@ AddType audio/ogg oga ogg opus AddType image/jpeg jpg jpeg AddType image/bmp bmp AddType image/svg+xml svg svgz +AddType image/x-icon ico ani cur AddType image/webp webp AddType video/mp4 f4v f4p m4v mp4 AddType video/ogg ogv diff --git a/ext/handle_ico/main.php b/ext/handle_ico/main.php index b615a59d..beda9596 100644 --- a/ext/handle_ico/main.php +++ b/ext/handle_ico/main.php @@ -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 * @return bool diff --git a/ext/handle_ico/test.php b/ext/handle_ico/test.php index b019eed0..fa130100 100644 --- a/ext/handle_ico/test.php +++ b/ext/handle_ico/test.php @@ -4,7 +4,6 @@ class IcoHandlerTest extends ShimmiePHPUnitTestCase { $this->log_in_as_user(); $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("get_ico/$image_id"); // test for no crash # FIXME: test that the thumb works # FIXME: test that it gets displayed properly