Package: libwww-mediawiki-client-perl
Version: 0.31-2+wuth3
Severity: important
Tags: patch

Dear Maintainer,

Mediawiki 1.19.5-1 (Wheezy and perhaps earlier) has changed the format
of <h1> lines.  The new line can be of the form:

 <h1 id="firstHeading" class="firstHeading"><span dir="auto">Editing Main 
Page</span></h1>

The <span> did not used to exist.

mvs uses the <h1> line to determine whether there was an error in
fetching the page.  But the <span> causes it not see the text and
reports an error with every page fetch.

The attached patch resolves this problem.

--- cut: debian/patches/wuth05-get-headline.patch ---
Index: libwww-mediawiki-client-perl-0.31/lib/WWW/Mediawiki/Client.pm
===================================================================
--- libwww-mediawiki-client-perl-0.31.orig/lib/WWW/Mediawiki/Client.pm  
2013-07-08 16:17:05.000000000 -0600
+++ libwww-mediawiki-client-perl-0.31/lib/WWW/Mediawiki/Client.pm       
2013-07-08 16:37:23.000000000 -0600
@@ -1343,7 +1343,7 @@
                 res   => $res,
             ) if ($headline);
         WWW::Mediawiki::Client::ServerPageException->throw(
-                error => "Could not identify the error in this context.",
+                error => "Could not find page headline.",
                 res   => $res,
             );
     }
@@ -1580,10 +1580,14 @@
 }
 
 sub _get_page_headline {
+    # Find and parse the page's headline.
+    # the headline may be of the form:
+    # <h1 id="firstHeading" class="firstHeading"><span dir="auto">Editing 
Template:Access Logged/Demo/Access Log</span></h1>
+
     my ($self, $doc) = @_;
     my $p = HTML::TokeParser->new(\$doc);
     $p->get_tag("h1");
-    my $text = $p->get_text;
+    my $text = $p->get_text( "/h1" );
     $text =~ s/
//gs;                      # convert endlines
     return $text;
 }
--- cut: debian/patches/wuth05-get-headline.patch ---


-- System Information:
Debian Release: 7.0
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-0.bpo.2-686-pae (SMP w/2 CPU cores)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libwww-mediawiki-client-perl depends on:
ii  libexception-class-perl  1.32-1
ii  libvcs-lite-perl         0.09-1
ii  libwww-perl              6.04-1
ii  libxml-libxml-perl       2.0001+dfsg-1
ii  perl                     5.14.2-21

libwww-mediawiki-client-perl recommends no packages.

libwww-mediawiki-client-perl suggests no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to