more $page-ry

git-svn-id: file:///home/shish/svn/shimmie2/trunk@271 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2007-07-12 08:57:29 +00:00
parent c1dd2b6009
commit cbb09958c4

View file

@ -62,7 +62,7 @@ class Upload extends Extension {
($config->get_int('upload_size', UPLOAD_DEFAULT_MAX_SIZE)).")"); ($config->get_int('upload_size', UPLOAD_DEFAULT_MAX_SIZE)).")");
} }
else if(!($info = getimagesize($file['tmp_name']))) { 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"); "PHP doesn't recognise this as an image file");
} }
else { else {
@ -71,10 +71,14 @@ class Upload extends Extension {
if($image->is_ok()) { if($image->is_ok()) {
$event = new UploadingImageEvent($image); $event = new UploadingImageEvent($image);
send_event($event); 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 { 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!"); "Something is not right!");
} }
} }