Skip Menu |

This queue is for tickets about the MediaWiki CPAN distribution.

Report information
The Basics
Id: 24489
Status: resolved
Priority: 0/
Queue: MediaWiki

People
Owner: Nobody in particular
Requestors: Florian.Lindner [...] BSHG.COM
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: MediaWiki-1.08 does not work with MediaWiki 1.9.0
Date: Mon, 22 Jan 2007 13:17:39 +0100
To: bug-MediaWiki [...] rt.cpan.org
From: "Lindner, Florian" <Florian.Lindner [...] BSHG.COM>
Perl-MediaWiki-1.08 does not work with the latest Version of MediaWiki 1.9.0. Getting articles with ->text($title) works, but updating with ->text($title, $article) does not. Apache access.log reports a GET 200 OK for ->text($title) and a POST 200 OK for ->text($title, $article), no errors in Apache error.log. The page is not updated in the wiki. Perl 5.8.7 sun-solaris8 MediaWiki-1.08 MediaWiki 1.9.0 PHP 5.1.4 (apache2handler) Apache/2.0.54
From: buzz [...] exotica.org.uk
I've just spent a couple of hours debugging this. Wireshark is my friend. Turns out the mediawiki module wasn't able to scrape the edittoken correctly. This was caused by the addition of a "\" character in the edittoken field (see http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=18112) Please find a diff for page.pm attached. I just added "\\" so it can be matched anywhere in the value. you might want to make it check for it specifically at the end?
--- page.pm 2007-01-29 03:45:25.000000000 +0000 +++ pagenew.pm 2007-03-18 01:38:46.000000000 +0000 @@ -44,7 +44,7 @@ $edittime_regex = qr/(?<=value=["'])[0-9]+(?=["'] name=["']wpEdittime["'])/; $watchthis_regex = qr/name=["']wpWatchthis["'] checked/; $minoredit_regex = qr/(?<=value=["'])1(?=["'] name=["']wpMinoredit["'])/; - $edittoken_regex = qr/(?<=value=")[0-9a-f]+(?=" name=["']wpEditToken["'])/; + $edittoken_regex = qr/(?<=value=")[0-9a-f\\]+(?=" name=["']wpEditToken["'])/; $edittoken_rev_regex = qr/(?<=name=['"]wpEditToken['"] value=")[0-9a-f]+(?=["'])/; $autosumm_regex = qr/(?<=name=["']wpAutoSummary["'] value=["'])[0-9a-f]+(?=["'])/; $edittoken_delete_regex = qr/.*wpEditToken["'] value=["'](.*?)["'].*/;
Subject: AW: [rt.cpan.org #24489] MediaWiki-1.08 does not work with MediaW iki 1.9.0
Date: Mon, 19 Mar 2007 14:05:05 +0100
To: bug-MediaWiki [...] rt.cpan.org
From: "Lindner, Florian" <Florian.Lindner [...] BSHG.COM>
Hi! I applied the patch with gnu patch 2.5.4 running patch -p0 < page.diff patch reported one successful edit Fetching pages with $wiki->text(title) works fine, editing pages with $wiki->text(title, text) does not. MediaWiki 1.9.3 Test program: use MediaWiki; my $wiki = MediaWiki->new(); $wiki->setup({ 'bot' => { user => 'USER', pass => 'PASS'}, 'wiki' => { host => 'localhost', path => 'wiki'} }); $wiki->refresh_messages(); $wiki->text("testpage", "foo bar"); This does not work. My fault or still a bug? Regards Florian Show quoted text
> -----Ursprüngliche Nachricht----- > Von: Jools Smyth via RT [mailto:bug-MediaWiki@rt.cpan.org] > Gesendet: Sonntag, 18. März 2007 02:50 > An: Lindner, Florian > Betreff: [rt.cpan.org #24489] MediaWiki-1.08 does not work > with MediaWiki 1.9.0 > > > <URL: http://rt.cpan.org/Ticket/Display.html?id=24489 > > > I've just spent a couple of hours debugging this. Wireshark is my > friend. Turns out the mediawiki module wasn't able to scrape the > edittoken correctly. This was caused by the addition of a "\" > character in the edittoken field (see > http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=18112) > > Please find a diff for page.pm attached. I just added "\\" so it can > be matched anywhere in the value. you might want to make it check for > it specifically at the end? > > >
From: buzz [...] exotica.org.uk
use MediaWiki; my $wiki = MediaWiki->new(); $wiki->setup({ 'bot' => { 'user' => 'USER', 'pass' => 'PASS'}, 'wiki' => { 'host' => 'localhost', 'path' => 'mediawiki'} }); $wiki->refresh_messages(); $wiki->text("testpage", "foo bar"); Show quoted text
> This does not work. My fault or still a bug?
See my changed above. I quoted the user/pass keys and you probably need to use "mediawiki" rather than "wiki" for path. The perl module needs the actual path to the mediawiki php's and not the alias/friendly url path Also find a new patch attached. It changes a couple of other Regular Expressions to include the "\" character. Just in case it needs this elsewhere also.
--- pageold.pm 2007-03-20 19:14:34.000000000 +0000 +++ page.pm 2007-03-20 19:24:07.000000000 +0000 @@ -44,9 +44,9 @@ $edittime_regex = qr/(?<=value=["'])[0-9]+(?=["'] name=["']wpEdittime["'])/; $watchthis_regex = qr/name=["']wpWatchthis["'] checked/; $minoredit_regex = qr/(?<=value=["'])1(?=["'] name=["']wpMinoredit["'])/; - $edittoken_regex = qr/(?<=value=")[0-9a-f]+(?=" name=["']wpEditToken["'])/; - $edittoken_rev_regex = qr/(?<=name=['"]wpEditToken['"] value=")[0-9a-f]+(?=["'])/; - $autosumm_regex = qr/(?<=name=["']wpAutoSummary["'] value=["'])[0-9a-f]+(?=["'])/; + $edittoken_regex = qr/(?<=value=")[0-9a-f\\]+(?=" name=["']wpEditToken["'])/; + $edittoken_rev_regex = qr/(?<=name=['"]wpEditToken['"] value=")[0-9a-f\\]+(?=["'])/; + $autosumm_regex = qr/(?<=name=["']wpAutoSummary["'] value=["'])[0-9a-f\\]+(?=["'])/; $edittoken_delete_regex = qr/.*wpEditToken["'] value=["'](.*?)["'].*/; $pagehistory_delete_regex = qr/.*<ul id\=["']pagehistory["']>(.*?)<\/ul>.*/;
Subject: AW: [rt.cpan.org #24489] MediaWiki-1.08 does not work with MediaW iki 1.9.0
Date: Wed, 21 Mar 2007 10:56:35 +0100
To: bug-MediaWiki [...] rt.cpan.org
From: "Lindner, Florian (ITD-P)" <Florian.Lindner [...] BSHG.COM>
Hi! Now "make test" succeeds for some tests. 04-2 fails 05-1 fails 06-1 fails Updating pages now works again, thank you! Regards Florian Show quoted text
> -----Ursprüngliche Nachricht----- > Von: Jools Smyth via RT [mailto:bug-MediaWiki@rt.cpan.org] > Gesendet: Dienstag, 20. März 2007 20:29 > An: Lindner, Florian (ITD-P) > Betreff: [rt.cpan.org #24489] MediaWiki-1.08 does not work > with MediaWiki 1.9.0 > > > <URL: http://rt.cpan.org/Ticket/Display.html?id=24489 > > > use MediaWiki; > my $wiki = MediaWiki->new(); > $wiki->setup({ > 'bot' => { 'user' => 'USER', 'pass' => 'PASS'}, > 'wiki' => { 'host' => 'localhost', 'path' => 'mediawiki'} > }); > > $wiki->refresh_messages(); > $wiki->text("testpage", "foo bar"); >
> > This does not work. My fault or still a bug?
> > See my changed above. I quoted the user/pass keys and you probably > need to use "mediawiki" rather than "wiki" for path. The perl module > needs the actual path to the mediawiki php's and not the > alias/friendly url path > > Also find a new patch attached. It changes a couple of other Regular > Expressions to include the "\" character. Just in case it needs this > elsewhere also. > > >
From: buzz [...] exotica.org.uk
On Wed Mar 21 05:57:15 2007, Florian.Lindner@BSHG.COM wrote: Show quoted text
> 04-2 fails
Fixed. The change I have made will break page history user functionality with earlier versions. Show quoted text
> 05-1 fails
worked ok here Show quoted text
> 06-1 fails
The upload regular expression was broken. Fixed now. Although if you install the FilePath extension it can use that instead which is faster than parsing the entire page See new diff. Apply to original page.pm Let me know how you get on.. I've not heard anything from the mediawiki perl module author. I sent him some mails some months ago and never got a reply to them either :(
--- /usr/share/perl5/MediaWiki/pageold.pm 2007-03-22 02:42:40.000000000 +0000 +++ /usr/share/perl5/MediaWiki/page.pm 2007-03-22 02:45:21.000000000 +0000 @@ -44,16 +44,16 @@ $edittime_regex = qr/(?<=value=["'])[0-9]+(?=["'] name=["']wpEdittime["'])/; $watchthis_regex = qr/name=["']wpWatchthis["'] checked/; $minoredit_regex = qr/(?<=value=["'])1(?=["'] name=["']wpMinoredit["'])/; - $edittoken_regex = qr/(?<=value=")[0-9a-f]+(?=" name=["']wpEditToken["'])/; - $edittoken_rev_regex = qr/(?<=name=['"]wpEditToken['"] value=")[0-9a-f]+(?=["'])/; - $autosumm_regex = qr/(?<=name=["']wpAutoSummary["'] value=["'])[0-9a-f]+(?=["'])/; + $edittoken_regex = qr/(?<=value=")[0-9a-f\\]+(?=" name=["']wpEditToken["'])/; + $edittoken_rev_regex = qr/(?<=name=['"]wpEditToken['"] value=")[0-9a-f\\]+(?=["'])/; + $autosumm_regex = qr/(?<=name=["']wpAutoSummary["'] value=["'])[0-9a-f\\]+(?=["'])/; $edittoken_delete_regex = qr/.*wpEditToken["'] value=["'](.*?)["'].*/; $pagehistory_delete_regex = qr/.*<ul id\=["']pagehistory["']>(.*?)<\/ul>.*/; $timestamp_regex = qr/(?<=>).*?(?=<\/a> <span class=['"]history\-user['"]>)/; $historyuser_regex1 = qr/(?<=<span class=["']history\-user["']>).*?(?=<\/span>)/; - $historyuser_regex2 = qr/(?<=&amp;target=).*?(?=["'])/; + $historyuser_regex2 = qr/(?<=Contributions\/).*?(?=["'])/; $noanon_regex = qr/contribs<\/a>/; $minor_regex = qr/span class=["']minor["']/; $autocomment_regex = qr/(?<=<span class=["']autocomment["']>).*?(?=<\/span>)/; @@ -65,7 +65,7 @@ $li_regex = qr/(?<=<li>).*?(?=<\/li>)/; $link_regex1 = qr/<a href=["']\/wiki\/(.*?)["'].*?title=["'](?:.*?)['"]>(.*?)<\/a>/; - $filepath_regex = qr/(?<=<div class=["']fullImageLink["'] id=["']file["']>)[.\n]*?(?=<\/div>)/; + $filepath_regex = qr/(?<=<div class=["']fullImageLink["'] id=["']file["']>).*?(?=<\/div>)/; $src_regex = qr/(?<=src=['"]).*?(?=['"])/; $oldid_regex = qr/(?<=&amp;oldid=)[0-9]+(?=")/;
From: buzz [...] exotica.org.uk
New patch attached. This one retains compatibility with 1.8 for the "page history user" functionality.
--- /usr/share/perl5/MediaWiki/pageold.pm 2007-03-22 02:42:40.000000000 +0000 +++ /usr/share/perl5/MediaWiki/page.pm 2007-03-22 03:03:55.000000000 +0000 @@ -44,16 +44,16 @@ $edittime_regex = qr/(?<=value=["'])[0-9]+(?=["'] name=["']wpEdittime["'])/; $watchthis_regex = qr/name=["']wpWatchthis["'] checked/; $minoredit_regex = qr/(?<=value=["'])1(?=["'] name=["']wpMinoredit["'])/; - $edittoken_regex = qr/(?<=value=")[0-9a-f]+(?=" name=["']wpEditToken["'])/; - $edittoken_rev_regex = qr/(?<=name=['"]wpEditToken['"] value=")[0-9a-f]+(?=["'])/; - $autosumm_regex = qr/(?<=name=["']wpAutoSummary["'] value=["'])[0-9a-f]+(?=["'])/; + $edittoken_regex = qr/(?<=value=")[0-9a-f\\]+(?=" name=["']wpEditToken["'])/; + $edittoken_rev_regex = qr/(?<=name=['"]wpEditToken['"] value=")[0-9a-f\\]+(?=["'])/; + $autosumm_regex = qr/(?<=name=["']wpAutoSummary["'] value=["'])[0-9a-f\\]+(?=["'])/; $edittoken_delete_regex = qr/.*wpEditToken["'] value=["'](.*?)["'].*/; $pagehistory_delete_regex = qr/.*<ul id\=["']pagehistory["']>(.*?)<\/ul>.*/; $timestamp_regex = qr/(?<=>).*?(?=<\/a> <span class=['"]history\-user['"]>)/; $historyuser_regex1 = qr/(?<=<span class=["']history\-user["']>).*?(?=<\/span>)/; - $historyuser_regex2 = qr/(?<=&amp;target=).*?(?=["'])/; + $historyuser_regex2 = qr/(?<=(Contributions\/|ns&amp;target=)).*?(?=["'])/; $noanon_regex = qr/contribs<\/a>/; $minor_regex = qr/span class=["']minor["']/; $autocomment_regex = qr/(?<=<span class=["']autocomment["']>).*?(?=<\/span>)/; @@ -65,7 +65,7 @@ $li_regex = qr/(?<=<li>).*?(?=<\/li>)/; $link_regex1 = qr/<a href=["']\/wiki\/(.*?)["'].*?title=["'](?:.*?)['"]>(.*?)<\/a>/; - $filepath_regex = qr/(?<=<div class=["']fullImageLink["'] id=["']file["']>)[.\n]*?(?=<\/div>)/; + $filepath_regex = qr/(?<=<div class=["']fullImageLink["'] id=["']file["']>).*?(?=<\/div>)/; $src_regex = qr/(?<=src=['"]).*?(?=['"])/; $oldid_regex = qr/(?<=&amp;oldid=)[0-9]+(?=")/;
From: gmillerd [...] gmail.com
On Wed Mar 21 23:08:00 2007, exobuzz wrote: Show quoted text
> New patch attached. This one retains compatibility with 1.8 > for the "page history user" functionality. >
Well done, thanks a alot.
Fixed in MediaWiki-1.10. Sorry for such a delay.