Subject: | Bug in filepath()/download() |
The download() and filepath() functions fail on my wiki (MediaWiki
1.7.1) because it puts a newline between the opening and closing tags of
the "fullImageLink" div.
The fix is very simple - make the $filepath_regex match more than one line.
Subject: | filepath_newline.patch |
--- .cpan/build/MediaWiki-1.07/lib/MediaWiki/page.pm 2006-08-19 14:33:39.000000000 +0100
+++ perl/share/perl/5.8.4/MediaWiki/page.pm 2006-08-24 22:34:54.000000000 +0100
@@ -64,7 +64,7 @@
$li_regex = qr/(?<=<li>).*?(?=<\/li>)/;
$link_regex1 = qr/<a href=["']\/wiki\/(.*?)["'].*?title=["'](?:.*?)['"]>(.*?)<\/a>/;
- $filepath_regex = qr/(?<=<div class=["']fullImageLink["'] id=["']file["']>).*?(?=<\/div>)/;
+ $filepath_regex = qr/(?<=<div class=["']fullImageLink["'] id=["']file["']>).*?(?=<\/div>)/s;
$src_regex = qr/(?<=src=['"]).*?(?=['"])/;
$oldid_regex = qr/(?<=&oldid=)[0-9]+(?=")/;