package MediaWiki::page; require Exporter; @ISA = qw(Exporter); @EXPORT = qw(); use strict; use vars qw( $edittime_regex $watchthis_regex $minoredit_regex $edittoken_regex $edittoken_rev_regex $autosumm_regex $edittoken_delete_regex $pagehistory_delete_regex $timestamp_regex $historyuser_regex1 $historyuser_regex_reg $historyuser_regex_anon $noanon_regex $minor_regex $autocomment_regex $autocomment_delete_regex $autocomment_clear_regex $unhex_regex $unhex_regex2 $comment_regex $li_regex $link_regex1 $filepath_regex $src_regex $oldid_regex $offset_regex $permission_error_regex ); our @protection = ("", "autoconfirmed", "sysop"); BEGIN { use URI::Escape qw(uri_escape); use HTTP::Request::Common; use MediaWiki qw(ERR_NO_ERROR ERR_NO_INIHASH ERR_PARSE_INI ERR_NO_AUTHINFO ERR_NO_MSGCACHE ERR_LOGIN_FAILED ERR_LOOP); # # We should compile all regular expressions first # $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_delete_regex = qr/^.*wpEditToken["'][^>]*?value=["'](.*?)["'].*$/s; $pagehistory_delete_regex = qr/.*