Proper checking for images from URL with a too-large filesize.

        Patch by grimsniffer. 

diffs (13 lines):

diff -r 3b04b672b92e -r dde231e4bf1b htdocs/editpics.bml
--- a/htdocs/editpics.bml       Wed Dec 16 09:29:17 2009 +0000
+++ b/htdocs/editpics.bml       Thu Dec 17 14:00:51 2009 +0000
@@ -836,7 +836,8 @@ sub parse_post_uploads
                     my $res = $ua->get($POST{$userpic_key});
                     $current_upload{image} = \$res->content if $res && 
$res->is_success;
                     $current_upload{error} = $ML{'.error.urlerror'} unless 
$current_upload{image};
-                    $current_upload{error} = $ML{'.error.urlfiletoolarge'} if 
length($current_upload{image}) > $MAX_UPLOAD;
+                    #Below, $current_upload{image} needs to be dereferenced 
because it contains a hash value.
+                    $current_upload{error} = $ML{'.error.urlfiletoolarge'} if 
length( ${ $current_upload{image} } ) > $MAX_UPLOAD;
                 }
                 push @uploads, \%current_upload;
             }
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to