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

Dear Maintainer,

With a recent version of mediawiki the namespace image: has been
renamed as file:.  Attempts to access image:xx pages will return
pages named file:xx, which causes mvs to fail.

The attached patch resolves this problem.

-- 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
Index: libwww-mediawiki-client-perl-0.31/lib/WWW/Mediawiki/Client.pm
===================================================================
--- libwww-mediawiki-client-perl-0.31.orig/lib/WWW/Mediawiki/Client.pm	2012-09-09 06:16:21.000000000 -0600
+++ libwww-mediawiki-client-perl-0.31/lib/WWW/Mediawiki/Client.pm	2012-09-09 06:18:23.000000000 -0600
@@ -1330,7 +1330,9 @@
     $self->{edit}->{def_minor} = $self->_get_edit_minor_default($doc);
     my $headline = Encode::encode("utf8", $self->_get_page_headline($doc));
     my $expected = lc $pagename;
-    unless (lc($headline) =~ /\Q$expected\E$/) {
+    my $expectedfile = $expected;
+    $expectedfile =~ s/^image:/file:/;
+    unless (lc($headline) =~ /\Q$expected\E$/ or lc($headline) =~ /\Q$expectedfile\E$/) {
         WWW::Mediawiki::Client::ServerPageException->throw(
 	        error => "The server could not resolve the page name
                         '$pagename', but responded that it was '$headline'.",
@@ -1827,7 +1829,10 @@
 
     my $headline = $self->_get_page_headline($doc);
     my $expect = ($commit ? $pagename : "Editing $pagename");
-    unless (lc($headline) eq lc($expect)) {
+    my $pagenamefile = lc($pagename);
+    $pagenamefile =~ s/^image:/file:/;
+    my $expectfile = ($commit ? $pagenamefile : "Editing $pagenamefile");
+    unless (lc($headline) eq lc($expect) or lc($headline) eq lc($expectfile)) {
         WWW::Mediawiki::Client::CommitException->throw(
 	        error => "The page you are trying to commit appears to contain a link which is associated with Wikispam.",
                 res   => $res,

Reply via email to