mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2009-09-21 12:35 am

[dw-free] need friendly error message when uploading unallowable icon files

[commit: http://hg.dwscoalition.org/dw-free/rev/5ecad953068f]

http://bugs.dwscoalition.org/show_bug.cgi?id=1786

Show friendlier error message when someone tries to upload an icon of the
wrong format.

Patch by [personal profile] kareila.

Files modified:
  • htdocs/editpics.bml
--------------------------------------------------------------------------------
diff -r e592e3f488fb -r 5ecad953068f htdocs/editpics.bml
--- a/htdocs/editpics.bml	Sun Sep 20 18:51:52 2009 +0000
+++ b/htdocs/editpics.bml	Mon Sep 21 00:35:50 2009 +0000
@@ -936,8 +936,11 @@ sub parse_large_upload
             return $mime;
         };
         
-        $upload{mime} = $format_magic->($magic)
-            or die "Unknown format for upload";
+        $upload{mime} = $format_magic->( $magic );
+        unless ( $upload{mime} ) {
+            $$errorref = "Unknown format for upload";
+            return $err->( $$errorref );
+        }
         
         # finished adding data for md5, create digest (but don't destroy original)
         $upload{md5sum} = $upload{md5ctx}->digest;
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org