Subject: | Edit Token Format Change |
Wikipedia changed the format of their Edit Token a few weeks back - they
added a plus ("+") before the backslash at the end of the token, as a
proxy defeating measure, IIRC. This requires a small change in the
$edittoken_regex in page.pm to allow the MediaWiki module to continue
working. A quick patch, which makes the change, and makes the same
change in $edittoken_rev_regex (and allows the plus to be there or not,
for backwards compatibility):
[tim@thor ~/wikipedia/lib/MediaWiki]$ diff -u page.pm.1 page.pm
--- page.pm.1 Fri May 18 05:39:52 2007
+++ page.pm Sat Aug 25 15:14:15 2007
@@ -47,8 +47,8 @@
$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]+\\?(?=["'])/;
+ $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=["'](.*?)["'].*$/s;
$pagehistory_delete_regex = qr/.*<ul
id\=["']pagehistory["']>(.*?)<\/ul>.*/;