wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[livejournal] r16306: LJSUP-5555

Committer: gprochaev
LJSUP-5555

U   trunk/cgi-bin/LJ/Userpic.pm
Modified: trunk/cgi-bin/LJ/Userpic.pm
===================================================================
--- trunk/cgi-bin/LJ/Userpic.pm	2010-03-03 07:22:12 UTC (rev 16305)
+++ trunk/cgi-bin/LJ/Userpic.pm	2010-03-03 08:05:38 UTC (rev 16306)
@@ -509,9 +509,13 @@
     my $maxbytesize = delete $opts{'maxbytesize'};
     croak("dataref not a scalarref") unless ref $dataref eq 'SCALAR';
 
+    my @errors;
     my $has_dangerous_content = 0;
     LJ::run_hook('has_image_dangerous_content', $dataref, \$has_dangerous_content);
-    die "Image has dangerous content" if $has_dangerous_content;
+    if ($has_dangerous_content) {
+        push @errors, LJ::errobj("Image has dangerous content");
+    }
+    LJ::throw(@errors) if $has_dangerous_content;
 
     croak("Unknown options: " . join(", ", scalar keys %opts)) if %opts;
 
@@ -529,7 +533,7 @@
 
     my $fmterror = 0;
 
-    my @errors;
+    @errors = ();
     if ($size > $MAX_UPLOAD) {
         push @errors, LJ::errobj("Userpic::Bytesize",
                                  size => $size,

Tags: livejournal, pm, wisest-owl
Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments