Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[ljcom] r8098: LJSV-850: prevent webs from dying in a c...

Committer: ailyin
LJSV-850: prevent webs from dying in a couple places when a recbill pmt cannot be loaded as cart

U   trunk/cgi-bin/LJ/Widget/ShoppingCartStatus.pm
U   trunk/htdocs/pay/modify.bml
U   trunk/htdocs/shop/view.bml
Modified: trunk/cgi-bin/LJ/Widget/ShoppingCartStatus.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/ShoppingCartStatus.pm	2009-12-22 11:07:51 UTC (rev 8097)
+++ trunk/cgi-bin/LJ/Widget/ShoppingCartStatus.pm	2009-12-23 10:13:39 UTC (rev 8098)
@@ -14,7 +14,7 @@
     my $remote = LJ::get_remote();
     my $get = $class->get_args;
     my $cart = $get->{'cart'} || $BML::COOKIE{cart};
-    my $cartobj = LJ::Pay::Payment::load_cart($cart);
+    my $cartobj = eval { LJ::Pay::Payment::load_cart($cart) };
     my $base_url = "$LJ::SITEROOT/pay/index.bml";
 
     my $body;

Modified: trunk/htdocs/pay/modify.bml
===================================================================
--- trunk/htdocs/pay/modify.bml	2009-12-22 11:07:51 UTC (rev 8097)
+++ trunk/htdocs/pay/modify.bml	2009-12-23 10:13:39 UTC (rev 8098)
@@ -26,7 +26,7 @@
     my $dbh = LJ::get_db_writer();
     my $remote = LJ::get_remote();
     my $cart = $POST{'cart'} || $COOKIE{cart};
-    my $cartobj = LJ::Pay::Payment::load_cart($cart);
+    my $cartobj = eval { LJ::Pay::Payment::load_cart($cart) };
 
     # make sure they own this cart
     if ($cartobj && $cartobj->{'userid'}) {

Modified: trunk/htdocs/shop/view.bml
===================================================================
--- trunk/htdocs/shop/view.bml	2009-12-22 11:07:51 UTC (rev 8097)
+++ trunk/htdocs/shop/view.bml	2009-12-23 10:13:39 UTC (rev 8098)
@@ -18,7 +18,7 @@
 
     # now load $remote and $cartobj
     $remote = LJ::get_remote();
-    $cartobj = LJ::Pay::Payment::load_cart($cart);
+    $cartobj = eval { LJ::Pay::Payment::load_cart($cart) };
     $can_mod = ! $cartobj || $cartobj->can_modify;
 
     # see if cart's dead, c=new requested, or already checked out

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