File: 0011-fix-ampersand.patch

package info (click to toggle)
libwww-mediawiki-client-perl 0.31-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,132 kB
  • sloc: perl: 1,672; makefile: 14
file content (18 lines) | stat: -rw-r--r-- 553 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Author: Brett Wuth <wuth@castrov.cuug.ab.ca>
Last-Update: 2011-03-16
Bug-Debian: https://bugs.debian.org/618611
Description: Fix downloading pages with ampersands in name

--- a/lib/WWW/Mediawiki/Client.pm
+++ b/lib/WWW/Mediawiki/Client.pm
@@ -1328,6 +1328,10 @@ sub pagename_to_url {
         ) if $name =~ /.wiki$/;
     my $char = $self->space_substitute;
     $name =~ s/ /$char/;
+
+    # ampersand is escaped in the URL
+    $name =~ s/&/%26/;
+
     my $lang = $self->language_code;
     my $host = $self->host;
     $host =~ s/__LANG__/$lang/g;