[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.8.8-732-g8de7a0b

Thomas Sibley trs at bestpractical.com
Wed Sep 8 15:19:54 EDT 2010


The branch, 3.9-trunk has been updated
       via  8de7a0b57ab1305214b71df02ede1ada71a18f40 (commit)
      from  5152fafa37475e27ae9cfd509c618c226e362e2f (commit)

Summary of changes:
 share/html/Admin/Global/Theme.html |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit 8de7a0b57ab1305214b71df02ede1ada71a18f40
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Wed Sep 8 15:18:24 2010 -0400

    Don't die horribly when an unknown format is uploaded

diff --git a/share/html/Admin/Global/Theme.html b/share/html/Admin/Global/Theme.html
index 688d82a..0e8cb3d 100644
--- a/share/html/Admin/Global/Theme.html
+++ b/share/html/Admin/Global/Theme.html
@@ -185,7 +185,10 @@ if (my $file_hash = _UploadedFile( 'logo-upload' )) {
                                                     type => $file_hash->{ContentType},
                                                     data => $file_hash->{LargeContent} } );
     $img = Imager->new;
-    $img->read(data => $file_hash->{LargeContent} );
+    unless ( $img->read(data => $file_hash->{LargeContent}) ) {
+        push @results, loc("Unable to read image: [_1]", $img->errstr);
+        undef $img;
+    }
 }
 elsif ($ARGS{'reset_logo'}) {
     $RT::System->DeleteAttribute('UserLogo');
@@ -195,7 +198,10 @@ else {
         my $content = $attr->Content;
         if (ref($content) eq 'HASH') {
             $img = Imager->new;
-            $img->read(data => $content->{data}) or die "Cannot read: ", $img->errstr;
+            unless ( $img->read(data => $content->{data}) ) {
+                push @results, loc("Unable to read image: [_1]", $img->errstr);
+                undef $img;
+            }
         }
         else {
             $RT::System->DeleteAttribute('UserLogo');

-----------------------------------------------------------------------


More information about the Rt-commit mailing list