From cbb09958c4f70815236029810084a3d775f318f6 Mon Sep 17 00:00:00 2001 From: shish Date: Thu, 12 Jul 2007 08:57:29 +0000 Subject: [PATCH] more $page-ry git-svn-id: file:///home/shish/svn/shimmie2/trunk@271 7f39781d-f577-437e-ae19-be835c7a54ca --- ext/upload/main.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ext/upload/main.php b/ext/upload/main.php index cf79a7cf..2e01b192 100644 --- a/ext/upload/main.php +++ b/ext/upload/main.php @@ -62,7 +62,7 @@ class Upload extends Extension { ($config->get_int('upload_size', UPLOAD_DEFAULT_MAX_SIZE)).")"); } else if(!($info = getimagesize($file['tmp_name']))) { - $this->theme->display_upload_error("Error with ".html_escape($file['name']), + $this->theme->display_upload_error($page, "Error with ".html_escape($file['name']), "PHP doesn't recognise this as an image file"); } else { @@ -71,10 +71,14 @@ class Upload extends Extension { if($image->is_ok()) { $event = new UploadingImageEvent($image); send_event($event); - $ok = $event->_live; + $ok = !$event->vetoed; + if(!$ok) { + $this->theme->display_upload_error($page, "Error with ".html_escape($file['name']), + $event->veto_reason); + } } else { - $this->theme->display_upload_error("Error with ".html_escape($file['name']), + $this->theme->display_upload_error($page, "Error with ".html_escape($file['name']), "Something is not right!"); } }