make non-nice images work

This commit is contained in:
Shish 2012-04-01 15:55:48 +01:00
parent 17c85ba549
commit ab128b4b24

View File

@ -150,17 +150,13 @@ class ImageIO extends Extension {
} }
public function onPageRequest(PageRequestEvent $event) { public function onPageRequest(PageRequestEvent $event) {
$num = $event->get_arg(0); if($event->page_matches("image")) {
$matches = array(); $num = int_escape($event->get_arg(0));
if(!is_null($num) && preg_match("/(\d+)/", $num, $matches)) { $this->send_file($num, "image");
$num = $matches[1]; }
if($event->page_matches("thumb")) {
if($event->page_matches("image")) { $num = int_escape($event->get_arg(0));
$this->send_file($num, "image"); $this->send_file($num, "thumb");
}
else if($event->page_matches("thumb")) {
$this->send_file($num, "thumb");
}
} }
if($event->page_matches("image_admin/delete")) { if($event->page_matches("image_admin/delete")) {
global $page, $user; global $page, $user;