kareila: (Default)
kareila ([personal profile] kareila) wrote in [site community profile] changelog2011-08-22 03:51 pm

[dw-free] can't parse "ascii" encoding (really?!?)

[commit: http://hg.dwscoalition.org/dw-free/rev/13dce58a9cb7]

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

Change "ascii" to "us-ascii" before passing off to XML parser.

Patch by [staff profile] denise.

Files modified:
  • cgi-bin/LJ/SynSuck.pm
--------------------------------------------------------------------------------
diff -r fcc8dbfae4b2 -r 13dce58a9cb7 cgi-bin/LJ/SynSuck.pm
--- a/cgi-bin/LJ/SynSuck.pm	Mon Aug 22 10:38:24 2011 -0500
+++ b/cgi-bin/LJ/SynSuck.pm	Mon Aug 22 10:51:20 2011 -0500
@@ -163,6 +163,11 @@
         $content =~ s/encoding=([\"\'])(.+?)\1/encoding='us-ascii'/;
     }
 
+    # and yet another hack, this time to alias 'ascii' to 'us-ascii'
+    if ( $encoding =~ /^ascii$/i ) {
+        $content =~ s/encoding=([\"\'])(.+?)\1/encoding='us-ascii'/;
+    }
+
     # parsing time...
     my ( $feed, $error ) = LJ::ParseFeed::parse_feed( $content );
     return ( 0, { type => "parseerror", message => $error } ) if $error;
--------------------------------------------------------------------------------
turlough: snickering white cat, Duchess from Disney's 'Aristocats' ((disney) fun)

[personal profile] turlough 2011-08-22 05:22 pm (UTC)(link)
can't parse "ascii" encoding (really?!?)

*snicker*