fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2010-12-28 02:29 pm

[dw-free] hush warnings in AtomAPI.pm

[commit: http://hg.dwscoalition.org/dw-free/rev/95a601bcc9a4]

http://bugs.dwscoalition.org/show_bug.cgi?id=3353

A few less warnings.

Patch by [personal profile] kareila.

Files modified:
  • cgi-bin/Apache/LiveJournal/Interface/AtomAPI.pm
--------------------------------------------------------------------------------
diff -r 0429c47708e3 -r 95a601bcc9a4 cgi-bin/Apache/LiveJournal/Interface/AtomAPI.pm
--- a/cgi-bin/Apache/LiveJournal/Interface/AtomAPI.pm	Tue Dec 28 21:24:15 2010 +0800
+++ b/cgi-bin/Apache/LiveJournal/Interface/AtomAPI.pm	Tue Dec 28 22:29:34 2010 +0800
@@ -165,7 +165,7 @@ sub handle_post {
     my $security_opts = { security => 'public' };
 
     # TODO Add code for handling this with XML::Atom::ext
-    if ($XML::Atom::Version <= .13) {
+    if ( ! $XML::Atom::Version || ( $XML::Atom::Version <= .13 ) ) {
         eval {
             foreach my $allow_element (map { XML::Atom::Util::nodelist($_, 'http://www.sixapart.com/ns/atom/privacy', 'allow') }
                                              XML::Atom::Util::nodelist($entry->{doc}, 'http://www.sixapart.com/ns/atom/privacy', 'privacy')) {
@@ -197,8 +197,8 @@ sub handle_post {
         }
     }
 
-    my $preformatted = $entry->get
-        ("http://sixapart.com/atom/post#", "convertLineBreaks") eq 'false' ? 1 : 0;
+    my $clb = $entry->get( "http://sixapart.com/atom/post#", "convertLineBreaks" );
+    my $preformatted = ( $clb && $clb eq 'false' ) ? 1 : 0;
 
     # build a post event request.
     my $req = {
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org