alf (red_alf) wrote in changelog,
alf
red_alf
changelog

[livejournal] r22991: LJSUP-13431: Antispam for edited entries...

Committer: afedorov
LJSUP-13431: Antispam for edited entries in the communities

U   trunk/cgi-bin/LJ/RelationService/MysqlAPI.pm
Modified: trunk/cgi-bin/LJ/RelationService/MysqlAPI.pm
===================================================================
--- trunk/cgi-bin/LJ/RelationService/MysqlAPI.pm	2012-09-27 10:41:57 UTC (rev 22990)
+++ trunk/cgi-bin/LJ/RelationService/MysqlAPI.pm	2012-09-27 10:50:24 UTC (rev 22991)
@@ -775,15 +775,18 @@
     my $types  = shift;
     my %opts   = @_;
     
-    return undef unless $types && $u && $friend;
+    return undef unless $u && $friend;
+    return undef unless ref $types eq 'ARRAY';
 
     my $userid = LJ::want_userid($u);
     my $friendid = LJ::want_userid($friend);
 
+    $types = join ",", map {"'$_'"} @$types;
+
     my $dbh = LJ::get_db_writer();
     my $relcount = $dbh->selectrow_array("SELECT COUNT(*) FROM reluser ".
                                          "WHERE userid=$userid AND targetid=$friendid ".
-                                         "AND type IN (?)", undef, $types);
+                                         "AND type IN ($types)");
     return $relcount;
 }
 

Tags: afedorov, livejournal, pm, red_alf
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