changelog_bot (changelog_bot) wrote in changelog,
changelog_bot
changelog_bot
changelog

[livejournal] r21651: LJSUP-11306: LJ.XMLRPC.editcomment user ...

Committer: nnikulochkina
LJSUP-11306: LJ.XMLRPC.editcomment user can't delete subject
U   trunk/cgi-bin/ljprotocol.pl
Modified: trunk/cgi-bin/ljprotocol.pl
===================================================================
--- trunk/cgi-bin/ljprotocol.pl	2012-04-05 11:28:03 UTC (rev 21650)
+++ trunk/cgi-bin/ljprotocol.pl	2012-04-05 11:46:39 UTC (rev 21651)
@@ -1060,9 +1060,9 @@
     my $parent = $comment->parent;
     return fail($err, 324) if $parent && $parent->{state} eq 'F';
 
-    my $new_comment = { map {$_ => $req->{$_}} grep { $req->{$_} } qw( picture_keyword preformat subject body) };
+    my $new_comment = { map {$_ => $req->{$_}} grep { defined $req->{$_} } qw( picture_keyword preformat subject body) };
     $new_comment->{editid} = $req->{dtalkid};
-    $new_comment->{body} = $comment->body_orig() unless(defined $new_comment->{body});
+    $new_comment->{body} = $comment->body_orig() unless($new_comment->{body}); # body can't be empty!
     $new_comment->{subject} = $comment->subject_orig() unless(defined $new_comment->{subject});
     $new_comment->{preformat} = $comment->prop('opt_preformatted') unless(defined $new_comment->{preformat});
 

Tags: changelog_bot, livejournal, nnikulochkina, pl
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