ssafronova (ssafronova) wrote in changelog,
ssafronova
ssafronova
changelog

[ljcom] r9855: LJSUP-7377: Wishlist - LJSUP-7638: Perio...

Committer: ssafronova
LJSUP-7377: Wishlist - LJSUP-7638: Periodically to wishlist user does not specify the creation of the post with wishes
U   trunk/cgi-bin/LJ/Hooks/SUP.pm
Modified: trunk/cgi-bin/LJ/Hooks/SUP.pm
===================================================================
--- trunk/cgi-bin/LJ/Hooks/SUP.pm	2010-12-16 09:41:28 UTC (rev 9854)
+++ trunk/cgi-bin/LJ/Hooks/SUP.pm	2010-12-16 12:15:59 UTC (rev 9855)
@@ -996,12 +996,16 @@
     my $remote = LJ::get_remote();
     return unless $remote;
 
-    if ($arg->{event} =~ /<lj-wishlist\s+wishid=['"](\d+)["']\s+userid=['"](\d+)['"]\s*\/?>/) {
-        my $wishid = $1;
-        my $userid = $2;
-        return unless $remote->userid eq $userid; # we will alter only your own wishlist
+    while ($arg->{event} =~ /<lj-wishlist(.*?)>/g) {
+        my $attr = $1;
+        my %attr;
+        while ($attr =~ /(\w+)=['"](\d+)["']/g) {
+            $attr{$1} = $2;
+        }
 
-        my $wish = LJ::WishElement->load($remote, $wishid);
+        return unless $remote->userid eq $attr{userid}; # we will alter only your own wishlist
+
+        my $wish = LJ::WishElement->load($remote, $attr{wishid});
         return unless $wish;
         $wish->update({ ditemid => $arg->{itemid} * 256 + $arg->{anum} });
     }

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