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

[ljcom] r10934: LJSUP-9652. vgift with the parameter "pe...

Committer: gprochaev
LJSUP-9652. vgift with the parameter "perl_class", containing a space, dies the whole server

U   trunk/cgi-bin/LJ/Pay/ShopVGift.pm
Modified: trunk/cgi-bin/LJ/Pay/ShopVGift.pm
===================================================================
--- trunk/cgi-bin/LJ/Pay/ShopVGift.pm	2011-08-30 04:14:21 UTC (rev 10933)
+++ trunk/cgi-bin/LJ/Pay/ShopVGift.pm	2011-08-30 06:09:25 UTC (rev 10934)
@@ -270,6 +270,10 @@
     my $self = shift;
     my %opts = @_;
 
+    ## Checking perl class
+    ## next call dies if the check is failed
+    LJ::ModuleCheck->have("LJ::Pay::ShopVGift::".$opts{perl_class});
+
     my (@fields, @fields_values);
     for ('vgift_name', 'perl_class', 'price', 'date_start', 'date_end', 'is_hidden', 'is_promo', 'is_disabled', 'is_charity', 'is_sponsored', 'avail_for', 'cnt_for_send', 'min_age', 'max_age', 'is_hidden_for_not_logged_in', 'available_bit') {
         if ( defined $opts{$_} ) {
@@ -630,7 +634,8 @@
     }
 
     ## Checking perl class
-    warn 'Perl class ('.$opts{perl_class}.') for vgift not found' unless LJ::ModuleCheck->have("LJ::Pay::ShopVGift::".$opts{perl_class});
+    ## next call dies if the check is failed
+    LJ::ModuleCheck->have("LJ::Pay::ShopVGift::".$opts{perl_class});
 
     my $dbh = LJ::get_db_writer();
     $dbh->do("

Tags: ljcom, 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