From 241a048b38cf148e79dc5889de29d4932ceea89c Mon Sep 17 00:00:00 2001 From: shish Date: Mon, 28 May 2007 21:40:26 +0000 Subject: [PATCH] fix ImageIO -- it doesn't take , it takes . git-svn-id: file:///home/shish/svn/shimmie2/trunk@138 7f39781d-f577-437e-ae19-be835c7a54ca --- core/ext/image.ext.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/core/ext/image.ext.php b/core/ext/image.ext.php index b6d7e425..569e42a9 100644 --- a/core/ext/image.ext.php +++ b/core/ext/image.ext.php @@ -6,14 +6,18 @@ class ImageIO extends Extension { // event handling {{{ public function receive_event($event) { - if(is_a($event, 'PageRequestEvent') && ($event->page == "image")) { - if(is_numeric($event->get_arg(0))) { - $this->send_file($event->get_arg(0), "image"); - } - } - if(is_a($event, 'PageRequestEvent') && ($event->page == "thumb")) { - if(is_numeric($event->get_arg(0))) { - $this->send_file($event->get_arg(0), "thumb"); + if(is_a($event, 'PageRequestEvent')) { + $num = $event->get_arg(0); + $matches = array(); + if(!is_null($num) && preg_match("/(\d+)/", $num, $matches)) { + $num = $matches[1]; + + if($event->page == "image") { + $this->send_file($num, "image"); + } + else if($event->page == "thumb") { + $this->send_file($num, "thumb"); + } } }