r22111 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22110‎ | r22111 | r22112 >
Date:16:51, 11 May 2007
Author:aaron
Status:old
Tags:
Comment:
*Some updates
Modified paths:
  • /branches/phase3_rev_deleted/includes/Article.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/Block.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/Database.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/DefaultSettings.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/EditPage.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/GlobalFunctions.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/HTMLForm.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/HttpFunctions.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/Image.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/Linker.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/OutputPage.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/Pager.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/Parser.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/PatrolLog.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/Profiler.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/ProtectionForm.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/QueryPage.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/RecentChange.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/Revision.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/SearchPostgres.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/Skin.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/SkinTemplate.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/SpecialBlockip.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/SpecialContributions.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/SpecialExport.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/SpecialImport.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/SpecialIpblocklist.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/SpecialListusers.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/SpecialPreferences.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/SpecialProtectedpages.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/SpecialResetpass.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/SpecialRevisiondelete.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/SpecialUndelete.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/SpecialUserlogin.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/SpecialUserrights.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/SpecialWhatlinkshere.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/Title.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/UserMailer.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/Wiki.php (modified) (history)
  • /branches/phase3_rev_deleted/includes/Xml.php (modified) (history)
  • /branches/phase3_rev_deleted/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: branches/phase3_rev_deleted/includes/SpecialUserrights.php
@@ -74,7 +74,7 @@
7575 * @param string $reason Reason for group change
7676 *
7777 */
78 - function saveUserGroups( $username, $removegroup, $addgroup, $reason ) {
 78+ function saveUserGroups( $username, $removegroup, $addgroup, $reason = '' ) {
7979 global $wgOut;
8080 $u = User::newFromName($username);
8181
@@ -108,7 +108,7 @@
109109 wfDebug( 'oldGroups: ' . print_r( $oldGroups, true ) );
110110 wfDebug( 'newGroups: ' . print_r( $newGroups, true ) );
111111
112 - wfRunHooks( 'UserRights', array( &$u, $addgroup, $removegroup ) );
 112+ wfRunHooks( 'UserRights', array( &$u, $addgroup, $removegroup ) );
113113 $log = new LogPage( 'rights' );
114114 $log->addEntry( 'rights', Title::makeTitle( NS_USER, $u->getName() ), $reason, array( $this->makeGroupNameList( $oldGroups ),
115115 $this->makeGroupNameList( $newGroups ) ) );
Index: branches/phase3_rev_deleted/includes/Xml.php
@@ -19,9 +19,7 @@
2020 public static function element( $element, $attribs = null, $contents = '') {
2121 $out = '<' . $element;
2222 if( !is_null( $attribs ) ) {
23 - foreach( $attribs as $name => $val ) {
24 - $out .= ' ' . $name . '="' . Sanitizer::encodeAttribute( $val ) . '"';
25 - }
 23+ $out .= self::expandAttributes( $attribs );
2624 }
2725 if( is_null( $contents ) ) {
2826 $out .= '>';
@@ -36,6 +34,25 @@
3735 }
3836
3937 /**
 38+ * Given an array of ('attributename' => 'value'), it generates the code
 39+ * to set the XML attributes : attributename="value".
 40+ * The values are passed to Sanitizer::encodeAttribute.
 41+ * Return null if no attributes given.
 42+ * @param $attribs Array of attributes for an XML element
 43+ */
 44+ private static function expandAttributes( $attribs ) {
 45+ if( is_null( $attribs ) ) {
 46+ return null;
 47+ } else {
 48+ $out = '';
 49+ foreach( $attribs as $name => $val ) {
 50+ $out .= ' ' . $name . '="' . Sanitizer::encodeAttribute( $val ) . '"';
 51+ }
 52+ return $out;
 53+ }
 54+ }
 55+
 56+ /**
4057 * Format an XML element as with self::element(), but run text through the
4158 * UtfNormal::cleanUp() validator first to ensure that no invalid UTF-8
4259 * is passed.
@@ -57,8 +74,12 @@
5875 return self::element( $element, $attribs, $contents );
5976 }
6077
61 - // Shortcuts
62 - public static function openElement( $element, $attribs = null ) { return self::element( $element, $attribs, null ); }
 78+ /** This open an XML element */
 79+ public static function openElement( $element, $attribs = null ) {
 80+ return '<' . $element . self::expandAttributes( $attribs ) . '>';
 81+ }
 82+
 83+ // Shortcut
6384 public static function closeElement( $element ) { return "</$element>"; }
6485
6586 /**
@@ -66,7 +87,7 @@
6788 * content you have is already valid xml.
6889 */
6990 public static function tags( $element, $attribs = null, $contents ) {
70 - return self::element( $element, $attribs, null ) . $contents . "</$element>";
 91+ return self::openElement( $element, $attribs ) . $contents . "</$element>";
7192 }
7293
7394 /**
@@ -165,6 +186,14 @@
166187 }
167188
168189 /**
 190+ * Convenience function to build an HTML password input field
 191+ * @return string HTML
 192+ */
 193+ public static function password( $name, $size=false, $value=false, $attribs=array() ) {
 194+ return self::input( $name, $size, $value, array_merge($attribs, array('type' => 'password')));
 195+ }
 196+
 197+ /**
169198 * Internal function for use in checkboxes and radio buttons and such.
170199 * @return array
171200 */
Index: branches/phase3_rev_deleted/includes/ProtectionForm.php
@@ -99,7 +99,7 @@
100100 return;
101101 }
102102
103 - list( $cascadeSources, $restrictions ) = $this->mTitle->getCascadeProtectionSources();
 103+ list( $cascadeSources, /* $restrictions */ ) = $this->mTitle->getCascadeProtectionSources();
104104
105105 if ( "" != $err ) {
106106 $wgOut->setSubtitle( wfMsgHtml( 'formerror' ) );
Index: branches/phase3_rev_deleted/includes/SpecialImport.php
@@ -328,12 +328,10 @@
329329 } else {
330330 $created = false;
331331
332 - $result = $dbw->select( 'revision',
333 - array('MIN(rev_timestamp) as created', 'MAX(rev_timestamp) as latest'),
 332+ $latest = $dbw->selectField( 'revision', 'MAX(rev_timestamp)',
334333 array( 'rev_page' => $pageId ), __METHOD__ );
335 - $row = $dbw->fetchObject($result);
336334 // Don't make fucked up alternating page histories
337 - if( $row && $row->latest > $this->timestamp && $row->created < $this->timestamp ) {
 335+ if( $latest && $latest > $this->timestamp ) {
338336 wfDebug( __METHOD__ . ": skipping existing revision for [[" .
339337 $this->title->getPrefixedText() . "]], timestamp " .
340338 $this->timestamp . "\n" );
@@ -860,13 +858,13 @@
861859 }
862860 }
863861
864 - function newFromURL( $url ) {
 862+ function newFromURL( $url, $method = 'GET' ) {
865863 wfDebug( __METHOD__ . ": opening $url\n" );
866864 # Use the standard HTTP fetch function; it times out
867865 # quicker and sorts out user-agent problems which might
868866 # otherwise prevent importing from large sites, such
869867 # as the Wikimedia cluster, etc.
870 - $data = Http::get( $url );
 868+ $data = Http::request( $method, $url );
871869 if( $data !== false ) {
872870 $file = tmpfile();
873871 fwrite( $file, $data );
@@ -885,7 +883,8 @@
886884 } else {
887885 $params = $history ? 'history=1' : '';
888886 $url = $link->getFullUrl( $params );
889 - return ImportStreamSource::newFromURL( $url );
 887+ # For interwikis, use POST to avoid redirects.
 888+ return ImportStreamSource::newFromURL( $url, "POST" );
890889 }
891890 }
892891 }
Index: branches/phase3_rev_deleted/includes/Article.php
@@ -371,10 +371,7 @@
372372 }
373373 }
374374
375 - // FIXME: Horrible, horrible! This content-loading interface just plain sucks.
376 - // We should instead work with the Revision object when we need it...
377 - $this->mContent = $revision->userCan( Revision::DELETED_TEXT ) ? $revision->getRawText() : "";
378 - //$this->mContent = $revision->getText();
 375+ $this->mContent = $revision->revText(); // Loads if user is allowed
379376
380377 $this->mUser = $revision->getUser();
381378 $this->mUserText = $revision->getUserText();
Index: branches/phase3_rev_deleted/includes/RecentChange.php
@@ -290,10 +290,8 @@
291291 * Makes an entry in the database corresponding to page creation
292292 * Note: the title object must be loaded with the new id using resetArticleID()
293293 * @todo Document parameters and return
294 - * @public
295 - * @static
296294 */
297 - public static function notifyNew( $timestamp, &$title, $minor, &$user, $comment, $bot = "default",
 295+ public static function notifyNew( $timestamp, &$title, $minor, &$user, $comment, $bot = 'default',
298296 $ip='', $size = 0, $newId = 0 )
299297 {
300298 if ( !$ip ) {
@@ -302,7 +300,7 @@
303301 $ip = '';
304302 }
305303 }
306 - if ( $bot == 'default' ) {
 304+ if ( $bot === 'default' ) {
307305 $bot = $user->isAllowed( 'bot' );
308306 }
309307
Index: branches/phase3_rev_deleted/includes/GlobalFunctions.php
@@ -429,18 +429,11 @@
430430 * @param $key String:
431431 */
432432 function wfMsgWeirdKey ( $key ) {
433 - $subsource = str_replace ( ' ' , '_' , $key ) ;
434 - $source = wfMsgForContentNoTrans( $subsource ) ;
435 - if ( wfEmptyMsg( $subsource, $source) ) {
436 - # Try again with first char lower case
437 - $subsource = strtolower ( substr ( $subsource , 0 , 1 ) ) . substr ( $subsource , 1 ) ;
438 - $source = wfMsgForContentNoTrans( $subsource ) ;
439 - }
440 - if ( wfEmptyMsg( $subsource, $source ) ) {
441 - # Didn't work either, return blank text
442 - $source = "" ;
443 - }
444 - return $source ;
 433+ $source = wfMsgGetKey( $key, false, true, false );
 434+ if ( wfEmptyMsg( $key, $source ) )
 435+ return "";
 436+ else
 437+ return $source;
445438 }
446439
447440 /**
@@ -454,6 +447,17 @@
455448 function wfMsgGetKey( $key, $useDB, $forContent = false, $transform = true ) {
456449 global $wgParser, $wgContLang, $wgMessageCache, $wgLang;
457450
 451+ /* <Vyznev> btw, is all that code in wfMsgGetKey() that check
 452+ * if the message cache exists of not really necessary, or is
 453+ * it just paranoia?
 454+ * <TimStarling> Vyznev: it's probably not necessary
 455+ * <TimStarling> I think I wrote it in an attempt to report DB
 456+ * connection errors properly
 457+ * <TimStarling> but eventually we gave up on using the
 458+ * message cache for that and just hard-coded the strings
 459+ * <TimStarling> it may have other uses, it's not mere paranoia
 460+ */
 461+
458462 if ( is_object( $wgMessageCache ) )
459463 $transstat = $wgMessageCache->getTransform();
460464
@@ -468,16 +472,18 @@
469473 $lang = &$wgLang;
470474 }
471475
 476+ # MessageCache::get() does this already, Language::getMessage() doesn't
 477+ # ISSUE: Should we try to handle "message/lang" here too?
 478+ $key = str_replace( ' ' , '_' , $wgContLang->lcfirst( $key ) );
 479+
472480 wfSuppressWarnings();
473 -
474481 if( is_object( $lang ) ) {
475482 $message = $lang->getMessage( $key );
476483 } else {
477484 $message = false;
478485 }
479486 wfRestoreWarnings();
480 - if($message === false)
481 - $message = Language::getMessage($key);
 487+
482488 if ( $transform && strstr( $message, '{{' ) !== false ) {
483489 $message = $wgParser->transformMsg($message, $wgMessageCache->getParserOptions() );
484490 }
Index: branches/phase3_rev_deleted/includes/SpecialUserlogin.php
@@ -32,6 +32,7 @@
3333 const WRONG_PASS = 5;
3434 const EMPTY_PASS = 6;
3535 const RESET_PASS = 7;
 36+ const ABORTED = 8;
3637
3738 var $mName, $mPassword, $mRetype, $mReturnTo, $mCookieCheck, $mPosted;
3839 var $mAction, $mCreateaccount, $mCreateaccountMail, $mMailmypassword;
@@ -364,6 +365,12 @@
365366 $u->load();
366367 }
367368
 369+ // Give general extensions, such as a captcha, a chance to abort logins
 370+ $abort = self::ABORTED;
 371+ if( !wfRunHooks( 'AbortLogin', array( $u, $this->mPassword, &$abort ) ) ) {
 372+ return $abort;
 373+ }
 374+
368375 if (!$u->checkPassword( $this->mPassword )) {
369376 if( $u->checkTemporaryPassword( $this->mPassword ) ) {
370377 // The e-mailed temporary password should not be used
@@ -393,16 +400,18 @@
394401 // reset form; bot interfaces etc will probably just
395402 // fail cleanly here.
396403 //
397 - return self::RESET_PASS;
 404+ $retval = self::RESET_PASS;
398405 } else {
399 - return '' == $this->mPassword ? self::EMPTY_PASS : self::WRONG_PASS;
 406+ $retval = '' == $this->mPassword ? self::EMPTY_PASS : self::WRONG_PASS;
400407 }
401408 } else {
402409 $wgAuth->updateUser( $u );
403410 $wgUser = $u;
404411
405 - return self::SUCCESS;
 412+ $retval = self::SUCCESS;
406413 }
 414+ wfRunHooks( 'LoginAuthenticateAudit', array( $u, $this->mPassword, $retval ) );
 415+ return $retval;
407416 }
408417
409418 function processLogin() {
@@ -696,6 +705,7 @@
697706 $wgOut->setPageTitle( wfMsg( 'userlogin' ) );
698707 $wgOut->setRobotpolicy( 'noindex,nofollow' );
699708 $wgOut->setArticleRelated( false );
 709+ $wgOut->disallowUserJs(); // just in case...
700710 $wgOut->addTemplate( $template );
701711 }
702712
Index: branches/phase3_rev_deleted/includes/SpecialWhatlinkshere.php
@@ -112,6 +112,11 @@
113113
114114 // Read an extra row as an at-end check
115115 $queryLimit = $limit + 1;
 116+
 117+ // enforce join order, sometimes namespace selector may
 118+ // trigger filesorts which are far less efficient than scanning many entries
 119+ $options[] = 'STRAIGHT_JOIN';
 120+
116121 $options['LIMIT'] = $queryLimit;
117122 $fields = array( 'page_id', 'page_namespace', 'page_title', 'page_is_redirect' );
118123
Index: branches/phase3_rev_deleted/includes/SpecialRevisiondelete.php
@@ -21,7 +21,7 @@
2222 // We need a target page (possible a dummy like User:#1)
2323 $page = Title::newFromUrl( $target, false );
2424 if( is_null( $page ) ) {
25 - $wgOut->showErrorPage( 'notargettitle', 'notargettext' );
 25+ $wgOut->addWikiText( wfMsgHtml( 'undelete-header' ) );
2626 return;
2727 }
2828
@@ -886,8 +886,7 @@
887887 return false;
888888 }
889889
890 - $m = explode('!',$oimage->mArchiveName);
891 - $timestamp = $m[0];
 890+ list($timestamp,$img) = explode('!',$oimage->mArchiveName,2);
892891
893892 $oldpath = wfImageArchiveDir( $oimage->mName ) . DIRECTORY_SEPARATOR . $oimage->mArchiveName;
894893 // Dupe the file into the file store
@@ -1096,6 +1095,10 @@
10971096 function updatePage( $title ) {
10981097 $title->invalidateCache();
10991098 $title->purgeSquid();
 1099+
 1100+ // Extensions that require referencing previous revisions may need this
 1101+ $article = new Article( $title );
 1102+ wfRunHooks( 'ArticleRevisionVisiblityUpdates', array( &$article ) );
11001103 }
11011104
11021105 /**
Index: branches/phase3_rev_deleted/includes/Linker.php
@@ -223,27 +223,21 @@
224224 if ( 0 == $aid ) {
225225 $retVal = $this->makeBrokenLinkObj( $nt, $text, $query, $trail, $prefix );
226226 } else {
227 - $threshold = $wgUser->getOption('stubthreshold') ;
228 - if ( $threshold > 0 ) {
229 - $dbr = wfGetDB( DB_SLAVE );
230 - $s = $dbr->selectRow(
231 - array( 'page' ),
232 - array( 'page_len',
233 - 'page_namespace',
234 - 'page_is_redirect' ),
235 - array( 'page_id' => $aid ), $fname ) ;
236 - if ( $s !== false ) {
237 - $size = $s->page_len;
238 - if ( $s->page_is_redirect OR $s->page_namespace != NS_MAIN ) {
239 - $size = $threshold*2 ; # Really big
240 - }
241 - } else {
242 - $size = $threshold*2 ; # Really big
 227+ $stub = false;
 228+ if ( $nt->isContentPage() ) {
 229+ $threshold = $wgUser->getOption('stubthreshold');
 230+ if ( $threshold > 0 ) {
 231+ $dbr = wfGetDB( DB_SLAVE );
 232+ $s = $dbr->selectRow(
 233+ array( 'page' ),
 234+ array( 'page_len',
 235+ 'page_is_redirect' ),
 236+ array( 'page_id' => $aid ), $fname ) ;
 237+ $stub = ( $s !== false && !$s->page_is_redirect &&
 238+ $s->page_len < $threshold );
243239 }
244 - } else {
245 - $size = 1 ;
246240 }
247 - if ( $size < $threshold ) {
 241+ if ( $stub ) {
248242 $retVal = $this->makeStubLinkObj( $nt, $text, $query, $trail, $prefix );
249243 } else {
250244 $retVal = $this->makeKnownLinkObj( $nt, $text, $query, $trail, $prefix );
@@ -511,8 +505,6 @@
512506 */
513507 function makeThumbLinkObj( $img, $label = '', $alt, $align = 'right', $params = array(), $framed=false , $manual_thumb = "" ) {
514508 global $wgStylePath, $wgContLang;
515 - $thumbUrl = '';
516 - $error = '';
517509
518510 $page = isset( $params['page'] ) ? $params['page'] : false;
519511
@@ -922,16 +914,33 @@
923915 function formatComment($comment, $title = NULL, $local = false) {
924916 wfProfileIn( __METHOD__ );
925917
926 - global $wgContLang;
 918+ # Sanitize text a bit:
927919 $comment = str_replace( "\n", " ", $comment );
928920 $comment = htmlspecialchars( $comment );
929921
930 - # The pattern for autogen comments is / * foo * /, which makes for
931 - # some nasty regex.
932 - # We look for all comments, match any text before and after the comment,
933 - # add a separator where needed and format the comment itself with CSS
 922+ # Render autocomments and make links:
 923+ $comment = $this->formatAutoComments( $comment, $title, $local );
 924+ $comment = $this->formatLinksInComment( $comment );
 925+
 926+ wfProfileOut( __METHOD__ );
 927+ return $comment;
 928+ }
 929+
 930+ /**
 931+ * The pattern for autogen comments is / * foo * /, which makes for
 932+ * some nasty regex.
 933+ * We look for all comments, match any text before and after the comment,
 934+ * add a separator where needed and format the comment itself with CSS
 935+ * Called by Linker::formatComment.
 936+ *
 937+ * @param $comment Comment text
 938+ * @param $title An optional title object used to links to sections
 939+ *
 940+ * @todo Document the $local parameter.
 941+ */
 942+ private function formatAutocomments( $comment, $title = NULL, $local = false ) {
934943 $match = array();
935 - while (preg_match('/(.*)\/\*\s*(.*?)\s*\*\/(.*)/', $comment,$match)) {
 944+ while (preg_match('!(.*)/\*\s*(.*?)\s*\*/(.*)!', $comment,$match)) {
936945 $pre=$match[1];
937946 $auto=$match[2];
938947 $post=$match[3];
@@ -963,10 +972,21 @@
964973 $comment=$pre.$auto.$post;
965974 }
966975
967 - # format regular and media links - all other wiki formatting
968 - # is ignored
 976+ return $comment;
 977+ }
 978+
 979+ /**
 980+ * Format regular and media links - all other wiki formatting is ignored
 981+ * Called by Linker::formatComment.
 982+ * @param $comment The comment text.
 983+ * @return Comment text with links using HTML.
 984+ */
 985+ private function formatLinksInComment( $comment ) {
 986+ global $wgContLang;
 987+
969988 $medians = '(?:' . preg_quote( Namespace::getCanonicalName( NS_MEDIA ), '/' ) . '|';
970989 $medians .= preg_quote( $wgContLang->getNsText( NS_MEDIA ), '/' ) . '):';
 990+
971991 while(preg_match('/\[\[:?(.*?)(\|(.*?))*\]\](.*)$/',$comment,$match)) {
972992 # Handle link renaming [[foo|text]] will show link as "text"
973993 if( "" != $match[3] ) {
@@ -993,7 +1013,7 @@
9941014 }
9951015 $comment = preg_replace( $linkRegexp, StringUtils::escapeRegexReplacement( $thelink ), $comment, 1 );
9961016 }
997 - wfProfileOut( __METHOD__ );
 1017+
9981018 return $comment;
9991019 }
10001020
@@ -1018,7 +1038,7 @@
10191039 return " <span class=\"comment\">($formatted)</span>";
10201040 }
10211041 }
1022 -
 1042+
10231043 /**
10241044 * Wrap and format the given revision's comment block, if the current
10251045 * user is allowed to view it.
Index: branches/phase3_rev_deleted/includes/Parser.php
@@ -1937,6 +1937,7 @@
19381938 # Look at the first character
19391939 if( $target != '' && $target{0} == '/' ) {
19401940 # / at end means we don't want the slash to be shown
 1941+ $m = array();
19411942 $trailingSlashes = preg_match_all( '%(/+)$%', $target, $m );
19421943 if( $trailingSlashes ) {
19431944 $noslash = $target = substr( $target, 1, -strlen($m[0][0]) );
@@ -4086,16 +4087,11 @@
40874088 $linkCache->addGoodLinkObj( $s->page_id, $title );
40884089 $this->mOutput->addLink( $title, $s->page_id );
40894090
4090 - if ( $threshold > 0 ) {
4091 - $size = $s->page_len;
4092 - if ( $s->page_is_redirect || $s->page_namespace != 0 || $size >= $threshold ) {
4093 - $colours[$pdbk] = 1;
4094 - } else {
4095 - $colours[$pdbk] = 2;
4096 - }
4097 - } else {
4098 - $colours[$pdbk] = 1;
4099 - }
 4091+ $colours[$pdbk] = ( $threshold == 0 || (
 4092+ $s->page_len >= $threshold || # always true if $threshold <= 0
 4093+ $s->page_is_redirect ||
 4094+ !Namespace::isContent( $s->page_namespace ) )
 4095+ ? 1 : 2 );
41004096 }
41014097 }
41024098 wfProfileOut( $fname.'-check' );
@@ -4595,7 +4591,7 @@
45964592 .+? # Section title...
45974593 \\2 # Ending = count must match start
45984594 (?:$comment|<\/?noinclude>|[ \\t]+)* # Trailing whitespace ok
4599 - # Bug 9156: don't require EOL here
 4595+ $
46004596 |
46014597 <h([1-6])\b.*?>
46024598 .*?
Index: branches/phase3_rev_deleted/includes/SpecialContributions.php
@@ -10,8 +10,6 @@
1111 var $namespace = '', $mDb;
1212
1313 function __construct( $target, $namespace = false ) {
14 - global $wgUser;
15 -
1614 parent::__construct();
1715 foreach( explode( ' ', 'uctop diff newarticle rollbacklink diff hist minoreditletter' ) as $msg ) {
1816 $this->messages[$msg] = wfMsgExt( $msg, array( 'escape') );
Index: branches/phase3_rev_deleted/includes/PatrolLog.php
@@ -46,7 +46,7 @@
4747 # these conditions would have gone into recentchanges, which we aren't
4848 # supposed to be updating
4949 if( is_object( $skin ) ) {
50 - list( $cur, $prev, $auto ) = $params;
 50+ list( $cur, /* $prev */, $auto ) = $params;
5151 # Standard link to the page in question
5252 $link = $skin->makeLinkObj( $title );
5353 # Generate a diff link
Index: branches/phase3_rev_deleted/includes/UserMailer.php
@@ -145,7 +145,7 @@
146146 if (is_array($dest)) {
147147 $chunks = array_chunk($dest, $wgEnotifMaxRecips);
148148 foreach ($chunks as $chunk) {
149 - $e = send_mail($mail_object, $dest, $headers, $body);
 149+ $e = send_mail($mail_object, $chunk, $headers, $body);
150150 if ($e != '')
151151 return $e;
152152 }
Index: branches/phase3_rev_deleted/includes/Profiler.php
@@ -301,6 +301,9 @@
302302 * @static
303303 */
304304 function logToDB($name, $timeSum, $eventCount) {
 305+ # Do not log anything if database is readonly (bug 5375)
 306+ if( wfReadOnly() ) { return; }
 307+
305308 # Warning: $wguname is a live patch, it should be moved to Setup.php
306309 global $wguname, $wgProfilePerHost;
307310
Index: branches/phase3_rev_deleted/includes/EditPage.php
@@ -1002,7 +1002,7 @@
10031003 }
10041004 if ( $this->mTitle->isCascadeProtected() ) {
10051005 # Is this page under cascading protection from some source pages?
1006 - list($cascadeSources, $restrictions) = $this->mTitle->getCascadeProtectionSources();
 1006+ list($cascadeSources, /* $restrictions */) = $this->mTitle->getCascadeProtectionSources();
10071007 if ( count($cascadeSources) > 0 ) {
10081008 # Explain, and list the titles responsible
10091009 $notice = wfMsgExt( 'cascadeprotectedwarning', array('parsemag'), count($cascadeSources) ) . "\n";
Index: branches/phase3_rev_deleted/includes/SpecialBlockip.php
@@ -65,7 +65,7 @@
6666 }
6767
6868 function showForm( $err ) {
69 - global $wgOut, $wgUser, $wgSysopUserBans;
 69+ global $wgOut, $wgUser, $wgSysopUserBans, $wgContLang;
7070
7171 $wgOut->setPagetitle( wfMsg( 'blockip' ) );
7272 $wgOut->addWikiText( wfMsg( 'blockiptext' ) );
@@ -84,6 +84,7 @@
8585
8686 $titleObj = SpecialPage::getTitleFor( 'Blockip' );
8787 $action = $titleObj->escapeLocalURL( "action=submit" );
 88+ $alignRight = $wgContLang->isRtl() ? 'left' : 'right';
8889
8990 if ( "" != $err ) {
9091 $wgOut->setSubtitle( wfMsgHtml( 'formerror' ) );
@@ -150,8 +151,8 @@
151152 <form id=\"blockip\" method=\"post\" action=\"{$action}\">
152153 <table border='0'>
153154 <tr>
154 - <td align=\"right\">{$mIpaddress}:</td>
155 - <td align=\"left\">
 155+ <td align=\"$alignRight\">{$mIpaddress}</td>
 156+ <td>
156157 " . Xml::input( 'wpBlockAddress', 45, $this->BlockAddress,
157158 array(
158159 'tabindex' => '1',
@@ -162,8 +163,8 @@
163164 <tr>");
164165 if ($showblockoptions) {
165166 $wgOut->addHTML("
166 - <td align=\"right\">{$mIpbexpiry}:</td>
167 - <td align=\"left\">
 167+ <td align=\"$alignRight\">{$mIpbexpiry}</td>
 168+ <td>
168169 <select tabindex='2' id='wpBlockExpiry' name=\"wpBlockExpiry\" onchange=\"considerChangingExpiryFocus()\">
169170 $blockExpiryFormOptions
170171 </select>
@@ -173,8 +174,8 @@
174175 $wgOut->addHTML("
175176 </tr>
176177 <tr id='wpBlockOther'>
177 - <td align=\"right\">{$mIpbother}:</td>
178 - <td align=\"left\">
 178+ <td align=\"$alignRight\">{$mIpbother}</td>
 179+ <td>
179180 " . Xml::input( 'wpBlockOther', 45, $this->BlockOther,
180181 array( 'tabindex' => '3', 'id' => 'mw-bi-other' ) ) . "
181182 </td>
@@ -182,8 +183,8 @@
183184 if ( $blockReasonList != '' ) {
184185 $wgOut->addHTML("
185186 <tr>
186 - <td align=\"right\">{$mIpbreasonother}:</td>
187 - <td align=\"left\">
 187+ <td align=\"$alignRight\">{$mIpbreasonother}</td>
 188+ <td>
188189 <select tabindex='4' id=\"wpBlockReasonList\" name=\"wpBlockReasonList\">
189190 $blockReasonList
190191 </select>
@@ -192,15 +193,15 @@
193194 }
194195 $wgOut->addHTML("
195196 <tr id=\"wpBlockReason\">
196 - <td align=\"right\">{$mIpbreason}:</td>
197 - <td align=\"left\">
 197+ <td align=\"$alignRight\">{$mIpbreason}</td>
 198+ <td>
198199 " . Xml::input( 'wpBlockReason', 45, $this->BlockReason,
199200 array( 'tabindex' => '5', 'id' => 'mw-bi-reason' ) ) . "
200201 </td>
201202 </tr>
202203 <tr id='wpAnonOnlyRow'>
203204 <td>&nbsp;</td>
204 - <td align=\"left\">
 205+ <td>
205206 " . wfCheckLabel( wfMsgHtml( 'ipbanononly' ),
206207 'wpAnonOnly', 'wpAnonOnly', $this->BlockAnonOnly,
207208 array( 'tabindex' => '6' ) ) . "
@@ -208,7 +209,7 @@
209210 </tr>
210211 <tr id='wpCreateAccountRow'>
211212 <td>&nbsp;</td>
212 - <td align=\"left\">
 213+ <td>
213214 " . wfCheckLabel( wfMsgHtml( 'ipbcreateaccount' ),
214215 'wpCreateAccount', 'wpCreateAccount', $this->BlockCreateAccount,
215216 array( 'tabindex' => '7' ) ) . "
@@ -216,7 +217,7 @@
217218 </tr>
218219 <tr id='wpEnableAutoblockRow'>
219220 <td>&nbsp;</td>
220 - <td align=\"left\">
 221+ <td>
221222 " . wfCheckLabel( wfMsgHtml( 'ipbenableautoblock' ),
222223 'wpEnableAutoblock', 'wpEnableAutoblock', $this->BlockEnableAutoblock,
223224 array( 'tabindex' => '8' ) ) . "
@@ -228,7 +229,7 @@
229230 $wgOut->addHTML("
230231 <tr>
231232 <td>&nbsp;</td>
232 - <td align=\"left\">
 233+ <td>
233234 " . wfCheckLabel( wfMsgHtml( 'ipbhidename' ),
234235 'wpHideName', 'wpHideName', $this->BlockHideName,
235236 array( 'tabindex' => '9' ) ) . "
@@ -239,7 +240,7 @@
240241 $wgOut->addHTML("
241242 <tr>
242243 <td style='padding-top: 1em'>&nbsp;</td>
243 - <td style='padding-top: 1em' align=\"left\">
 244+ <td style='padding-top: 1em'>
244245 " . Xml::submitButton( wfMsg( 'ipbsubmit' ),
245246 array( 'name' => 'wpBlock', 'tabindex' => '10' ) ) . "
246247 </td>
@@ -377,7 +378,7 @@
378379 # Make log entry, if the name is hidden, put it in the oversight log
379380 $log_type = ($this->BlockHideName) ? 'oversight' : 'block';
380381 $log = new LogPage( $log_type );
381 - $log->addEntry( 'block', Title::makeTitle( NS_USER, $this->BlockAddress ),
 382+ $log->addEntry( $log_type, Title::makeTitle( NS_USER, $this->BlockAddress ),
382383 $reasonstr, $logParams );
383384
384385 # Report to the user
Index: branches/phase3_rev_deleted/includes/HTMLForm.php
@@ -134,7 +134,7 @@
135135 $attribs = array( 'name' => $selectname );
136136 }
137137 $attribs['style'] = 'width: 100%';
138 - $out .= wfElement( 'select', $attribs, null );
 138+ $out .= wfOpenElement( 'select', $attribs );
139139
140140 foreach( $groups as $group ) {
141141 $attribs = array( 'value' => $group );
Index: branches/phase3_rev_deleted/includes/SearchPostgres.php
@@ -64,6 +64,7 @@
6565 $term = preg_replace('/:/', ' ', $term);
6666
6767 $searchstring = '';
 68+ $m = array();
6869 if( preg_match_all('/([-!]?)(\S+)\s*/', $term, $m, PREG_SET_ORDER ) ) {
6970 foreach( $m as $terms ) {
7071 if (strlen($terms[1])) {
Index: branches/phase3_rev_deleted/includes/OutputPage.php
@@ -15,6 +15,7 @@
1616 var $mLastModified, $mETag, $mCategoryLinks;
1717 var $mScripts, $mLinkColours, $mPageLinkTitle;
1818
 19+ var $mAllowUserJs;
1920 var $mSuppressQuickbar;
2021 var $mOnloadHandler;
2122 var $mDoNothing;
@@ -33,6 +34,8 @@
3435 * Initialise private variables
3536 */
3637 function __construct() {
 38+ global $wgAllowUserJs;
 39+ $this->mAllowUserJs = $wgAllowUserJs;
3740 $this->mMetatags = $this->mKeywords = $this->mLinktags = array();
3841 $this->mHTMLtitle = $this->mPagetitle = $this->mBodytext =
3942 $this->mRedirect = $this->mLastModified =
@@ -283,6 +286,9 @@
284287 public function suppressQuickbar() { $this->mSuppressQuickbar = true; }
285288 public function isQuickbarSuppressed() { return $this->mSuppressQuickbar; }
286289
 290+ public function disallowUserJs() { $this->mAllowUserJs = false; }
 291+ public function isUserJsAllowed() { return $this->mAllowUserJs; }
 292+
287293 public function addHTML( $text ) { $this->mBodytext .= $text; }
288294 public function clearHTML() { $this->mBodytext = ''; }
289295 public function getHTML() { return $this->mBodytext; }
@@ -937,7 +943,7 @@
938944 $this->setPageTitle( wfMsg( 'viewsource' ) );
939945 $this->setSubtitle( wfMsg( 'viewsourcefor', $skin->makeKnownLinkObj( $wgTitle ) ) );
940946
941 - list( $cascadeSources, $restrictions ) = $wgTitle->getCascadeProtectionSources();
 947+ list( $cascadeSources, /* $restrictions */ ) = $wgTitle->getCascadeProtectionSources();
942948
943949 # Determine if protection is due to the page being a system message
944950 # and show an appropriate explanation
@@ -1138,7 +1144,7 @@
11391145 $ret .= "<link rel='stylesheet' type='text/css' $media href='$printsheet' />\n";
11401146
11411147 $sk = $wgUser->getSkin();
1142 - $ret .= $sk->getHeadScripts();
 1148+ $ret .= $sk->getHeadScripts( $this->mAllowUserJs );
11431149 $ret .= $this->mScripts;
11441150 $ret .= $sk->getUserStyles();
11451151 $ret .= $this->getHeadItems();
Index: branches/phase3_rev_deleted/includes/SpecialResetpass.php
@@ -74,6 +74,8 @@
7575
7676 function showForm() {
7777 global $wgOut, $wgUser, $wgRequest;
 78+
 79+ $wgOut->disallowUserJs();
7880
7981 $self = SpecialPage::getTitleFor( 'Resetpass' );
8082 $form =
Index: branches/phase3_rev_deleted/includes/SpecialProtectedpages.php
@@ -219,8 +219,7 @@
220220 $lb = new LinkBatch;
221221
222222 while ( $row = $this->mResult->fetchObject() ) {
223 - $name = str_replace( ' ', '_', $row->page_title );
224 - $lb->add( $row->page_namespace, $name );
 223+ $lb->add( $row->page_namespace, $row->page_title );
225224 }
226225
227226 $lb->execute();
@@ -239,10 +238,11 @@
240239 $conds[] = 'page_id=pr_page';
241240 $conds[] = 'pr_type=' . $this->mDb->addQuotes( $this->type );
242241
243 - if( $this->sizetype=='min' )
 242+ if( $this->sizetype=='min' ) {
244243 $conds[] = 'page_len>=' . $this->size;
245 - else if( $this->sizetype=='max' )
 244+ } else if( $this->sizetype=='max' ) {
246245 $conds[] = 'page_len<=' . $this->size;
 246+ }
247247
248248 if( $this->level )
249249 $conds[] = 'pr_level=' . $this->mDb->addQuotes( $this->level );
Index: branches/phase3_rev_deleted/includes/Revision.php
@@ -96,7 +96,7 @@
9797 } else if ( $row->log_action=='restore' ) {
9898 // Check the restore point (format is <page time><\n><image time>)
9999 $restpoints = explode('\n',$row->log_params);
100 - if ( $restpoints[0] >= $timeframe ) {
 100+ if ( $restpoints[0] >= 0 && $restpoints[0] <= $timeframe ) {
101101 $isdeleted = false; // our desired revision was restored
102102 $d = "log_action='delete'";
103103 $r = '1 = 0';
Index: branches/phase3_rev_deleted/includes/Wiki.php
@@ -158,7 +158,7 @@
159159 $title = SpecialPage::getTitleFor( 'Badtitle' );
160160 throw new ErrorPageError( 'badtitle', 'badtitletext' );
161161 }
162 - } else if ( ( $action == 'view' ) &&
 162+ } else if ( ( $action == 'view' ) && !$wgRequest->wasPosted() &&
163163 (!isset( $this->GET['title'] ) || $title->getPrefixedDBKey() != $this->GET['title'] ) &&
164164 !count( array_diff( array_keys( $this->GET ), array( 'action', 'title' ) ) ) )
165165 {
Index: branches/phase3_rev_deleted/includes/SpecialUndelete.php
@@ -461,12 +461,10 @@
462462 }
463463 // If there were any revisions restored
464464 if( $revision ) {
465 - // If we have to create a new page entry
466 - // or this is now the newest live revision,
467 - // then set the page entry to point to it
468 - if( $newid || $revision->getTimestamp() > $previousTimestamp ) {
469 - // Attach the latest revision to the page...
470 - $article->updateRevisionOn( $dbw, $revision, $previousRevId );
 465+ // Attach the latest revision to the page...
 466+ $wasnew = $article->updateIfNewerOn( $dbw, $revision, $previousRevId );
 467+
 468+ if( $newid || $wasnew ) {
471469 // Update site stats, link tables, etc
472470 $article->createUpdates( $revision );
473471 }
@@ -892,7 +890,7 @@
893891 $wgOut->addHtml( "<h2 id=\"filehistory\">" . wfMsgHtml( 'imghistory' ) . "</h2>\n" );
894892 $wgOut->addHTML( wfMsgHtml( "restorepoint" ) );
895893 $wgOut->addHtml( "<ul>" );
896 - $wgOut->addHTML( "<li>" . wfRadio( "imgrestorepoint", -1, false ) . wfMsgHtml('restorenone') . "</li>" );
 894+ $wgOut->addHTML( "<li>" . wfRadio( "imgrestorepoint", -1, false ) . " " . wfMsgHtml('restorenone') . "</li>" );
897895 while( $row = $files->fetchObject() ) {
898896 $ts = wfTimestamp( TS_MW, $row->fa_timestamp );
899897 if ( $this->mAllowed && $row->fa_storage_key ) {
@@ -958,7 +956,9 @@
959957 $titleObj = SpecialPage::getTitleFor( "Undelete" );
960958 $pageLink = $this->getPageLink( $row, $titleObj, $ts, $this->mTarget );
961959 # Last link
962 - if ( isset($this->prevId[$row->ar_rev_id]) )
 960+ if ( !$this->userCan( $row, Revision::DELETED_TEXT ) )
 961+ $last = $this->message['last'];
 962+ else if ( isset($this->prevId[$row->ar_rev_id]) )
963963 $last = $this->sk->makeKnownLinkObj( $titleObj, $this->message['last'], "target=" . $this->mTarget .
964964 "&diff=" . $row->ar_rev_id . "&oldid=" . $this->prevId[$row->ar_rev_id] );
965965 } else {
Index: branches/phase3_rev_deleted/includes/SpecialIpblocklist.php
@@ -77,7 +77,7 @@
7878 }
7979
8080 function showForm( $err ) {
81 - global $wgOut, $wgUser, $wgSysopUserBans;
 81+ global $wgOut, $wgUser, $wgSysopUserBans, $wgContLang;
8282
8383 $wgOut->setPagetitle( wfMsg( 'unblockip' ) );
8484 $wgOut->addWikiText( wfMsg( 'unblockiptext' ) );
@@ -87,6 +87,7 @@
8888 $ipus = wfMsgHtml( 'ipusubmit' );
8989 $titleObj = SpecialPage::getTitleFor( "Ipblocklist" );
9090 $action = $titleObj->getLocalURL( "action=submit" );
 91+ $alignRight = $wgContLang->isRtl() ? 'left' : 'right';
9192
9293 if ( "" != $err ) {
9394 $wgOut->setSubtitle( wfMsg( "formerror" ) );
@@ -111,24 +112,24 @@
112113 Xml::openElement( 'form', array( 'method' => 'post', 'action' => $action, 'id' => 'unblockip' ) ) .
113114 Xml::openElement( 'table', array( 'border' => '0' ) ).
114115 "<tr>
115 - <td align='right'>
116 - {$ipa}:
 116+ <td align='$alignRight'>
 117+ {$ipa}
117118 </td>
118 - <td align='left'>
 119+ <td>
119120 {$addressPart}
120121 </td>
121122 </tr>
122123 <tr>
123 - <td align='right'>
124 - {$ipr}:
 124+ <td align='$alignRight'>
 125+ {$ipr}
125126 </td>
126 - <td align='left'>" .
 127+ <td>" .
127128 Xml::input( 'wpUnblockReason', 40, $this->reason, array( 'type' => 'text', 'tabindex' => '2' ) ) .
128129 "</td>
129130 </tr>
130131 <tr>
131132 <td>&nbsp;</td>
132 - <td align='left'>" .
 133+ <td>" .
133134 Xml::submitButton( $ipus, array( 'name' => 'wpBlock', 'tabindex' => '3' ) ) .
134135 "</td>
135136 </tr>" .
@@ -223,46 +224,30 @@
224225 }
225226 }
226227
227 - # TODO: difference message between
228 - # a) an real empty list and
229 - # b) requested ip/username not on list
230228 $pager = new IPBlocklistPager( $this, $conds );
231229 if ( $pager->getNumRows() ) {
232 - $s = $this->searchForm() .
233 - $pager->getNavigationBar();
234 - $s .= "<ul>" .
235 - $pager->getBody() .
236 - "</ul>";
237 - $s .= $pager->getNavigationBar();
 230+ $wgOut->addHTML(
 231+ $this->searchForm() .
 232+ $pager->getNavigationBar() .
 233+ Xml::tags( 'ul', null, $pager->getBody() ) .
 234+ $pager->getNavigationBar()
 235+ );
 236+ } elseif ( $this->ip != '') {
 237+ $wgOut->addHTML( $this->searchForm() );
 238+ $wgOut->addWikiText( wfMsg( 'ipblocklist-no-results' ) );
238239 } else {
239 - $s = $this->searchForm() .
240 - '<p>' . wfMsgHTML( 'ipblocklistempty' ) . '</p>';
 240+ $wgOut->addWikiText( wfMsg( 'ipblocklist-empty' ) );
241241 }
242 - $wgOut->addHTML( $s );
243242 }
244243
245244 function searchForm() {
246245 global $wgTitle, $wgScript, $wgRequest;
247246 return
248 - wfElement( 'form', array(
249 - 'action' => $wgScript ),
250 - null ) .
251 - wfHidden( 'title', $wgTitle->getPrefixedDbKey() ) .
252 - wfElement( 'input', array(
253 - 'type' => 'hidden',
254 - 'name' => 'action',
255 - 'value' => 'search' ) ).
256 - wfElement( 'input', array(
257 - 'type' => 'hidden',
258 - 'name' => 'limit',
259 - 'value' => $wgRequest->getText( 'limit' ) ) ) .
260 - wfElement( 'input', array(
261 - 'name' => 'ip',
262 - 'value' => $this->ip ) ) .
263 - wfElement( 'input', array(
264 - 'type' => 'submit',
265 - 'value' => wfMsg( 'ipblocklist-submit' ) ) ) .
266 - '</form>';
 247+ Xml::tags( 'form', array( 'action' => $wgScript ),
 248+ Xml::hidden( 'title', $wgTitle->getPrefixedDbKey() ) .
 249+ Xml::input( 'ip', /*size*/ false, $this->ip ) .
 250+ Xml::submitButton( wfMsg( 'ipblocklist-submit' ) )
 251+ );
267252 }
268253
269254 /**
Index: branches/phase3_rev_deleted/includes/Title.php
@@ -40,7 +40,7 @@
4141 * Please use the accessor functions
4242 */
4343
44 - /**#@+
 44+ /**#@+
4545 * @private
4646 */
4747
@@ -2407,11 +2407,14 @@
24082408 * Should a link should be displayed as a known link, just based on its title?
24092409 *
24102410 * Currently, a self-link with a fragment and special pages are in
2411 - * this category. Special pages never exist in the database.
 2411+ * this category. Special pages never exist in the database. System
 2412+ * messages that have defined default values are also always known.
24122413 */
24132414 public function isAlwaysKnown() {
2414 - return $this->isExternal() || ( 0 == $this->mNamespace && "" == $this->mDbkeyform )
2415 - || NS_SPECIAL == $this->mNamespace;
 2415+ return ( $this->isExternal() ||
 2416+ ( 0 == $this->mNamespace && "" == $this->mDbkeyform ) ||
 2417+ ( NS_SPECIAL == $this->mNamespace ) ||
 2418+ ( NS_MEDIAWIKI == $this->mNamespace && wfMsgWeirdKey( $this->mDbkeyform ) ) );
24162419 }
24172420
24182421 /**
Index: branches/phase3_rev_deleted/includes/Image.php
@@ -898,7 +898,7 @@
899899 if ( !$handler ) {
900900 return null;
901901 }
902 - list( $thumbExt, $thumbMime ) = self::getThumbType( $this->extension, $this->mime );
 902+ list( $thumbExt, /* $thumbMime */ ) = self::getThumbType( $this->extension, $this->mime );
903903 $thumbName = $handler->makeParamString( $params ) . '-' . $this->fileName;
904904 if ( $thumbExt != $this->extension ) {
905905 $thumbName .= ".$thumbExt";
@@ -992,17 +992,19 @@
993993 $thumbPath = wfImageThumbDir( $this->name, $this->fromSharedDirectory ) . "/$thumbName";
994994 $thumbUrl = $this->thumbUrlFromName( $thumbName );
995995
996 - $this->migrateThumbFile( $thumbName );
997996
998 - if ( file_exists( $thumbPath ) ) {
 997+ if ( !$wgGenerateThumbnailOnParse && !($flags & self::RENDER_NOW ) ) {
999998 $thumb = $handler->getTransform( $this, $thumbPath, $thumbUrl, $params );
1000999 break;
10011000 }
1002 -
1003 - if ( !$wgGenerateThumbnailOnParse && !($flags & self::RENDER_NOW ) ) {
 1001+
 1002+ wfDebug( "Doing stat for $thumbPath\n" );
 1003+ $this->migrateThumbFile( $thumbName );
 1004+ if ( file_exists( $thumbPath ) ) {
10041005 $thumb = $handler->getTransform( $this, $thumbPath, $thumbUrl, $params );
10051006 break;
10061007 }
 1008+
10071009 $thumb = $handler->doTransform( $this, $thumbPath, $thumbUrl, $params );
10081010
10091011 // Ignore errors if requested
@@ -1137,7 +1139,6 @@
11381140 $dir = wfImageThumbDir( $this->name, $shared );
11391141 $urls = array();
11401142 foreach ( $files as $file ) {
1141 - $m = array();
11421143 # Check that the base image name is part of the thumb name
11431144 # This is a basic sanity check to avoid erasing unrelated directories
11441145 if ( strpos( $file, $this->name ) !== false ) {
@@ -1477,7 +1478,6 @@
14781479 }
14791480
14801481 function getExifData() {
1481 - global $wgRequest;
14821482 $handler = $this->getHandler();
14831483 if ( !$handler || $handler->getMetadataType( $this ) != 'exif' ) {
14841484 return array();
@@ -1667,7 +1667,8 @@
16681668 * @return FStransaction on success, false on failure
16691669 */
16701670 private function prepareDeleteOld( $archiveName, $reason, $suppress=false ) {
1671 - list($timestamp,$img) = explode('!',$archiveName);
 1671+ // Stored as either <time>!<name> or <time>!<key>
 1672+ list($timestamp,$img) = explode('!',$archiveName,2);
16721673 // Is this image using a filestore key (hidden)?
16731674 if( $img != $this->name && FileStore::validKey($img) ) {
16741675 $group = 'hidden';
@@ -1804,6 +1805,15 @@
18051806 try {
18061807 $dbw = wfGetDB( DB_MASTER );
18071808 $dbw->begin();
 1809+
 1810+ // Make sure there is a page for this image
 1811+ $page = $dbw->selectRow( 'page',
 1812+ array( 'page_id', 'page_latest' ),
 1813+ array( 'page_namespace' => $this->title->getNamespace(),
 1814+ 'page_title' => $this->title->getDBkey() ),
 1815+ __METHOD__ );
 1816+ if( !$page )
 1817+ return false;
18081818
18091819 // Re-confirm whether this image presently exists;
18101820 // if no we'll need to create an image record for the
@@ -1834,11 +1844,7 @@
18351845 }
18361846
18371847 $revisions = 0;
1838 - while( $row = $dbw->fetchObject( $result ) ) {
1839 - if( ($row->fa_deleted & Revision::DELETED_RESTRICTED) && !$wgUser->isAllowed('hiderevision') ) {
1840 - // Skip restoring file revisions that the user cannot restore
1841 - continue;
1842 - }
 1848+ while( $row = $dbw->fetchObject( $result ) ) {
18431849 $revisions++;
18441850 $store = FileStore::get( $row->fa_storage_group );
18451851 if( !$store ) {
@@ -1908,7 +1914,7 @@
19091915 $archiveName = wfTimestamp( TS_MW, $row->fa_deleted_timestamp ) . '!' . $row->fa_name;
19101916 }
19111917
1912 - list($timestamp,$img) = explode('!',$archiveName);
 1918+ list($timestamp,$img) = explode('!',$archiveName,2);
19131919 // Is this image hidden?
19141920 if( !$Unsuppress && $row->fa_deleted & Image::DELETED_FILE ) {
19151921 $group = 'hidden';
Index: branches/phase3_rev_deleted/includes/SpecialExport.php
@@ -71,7 +71,7 @@
7272 }
7373 }
7474 }
75 - else if( $wgRequest->wasPosted() ) {
 75+ else if( $wgRequest->wasPosted() && $page == '' ) {
7676 $page = $wgRequest->getText( 'pages' );
7777 $curonly = $wgRequest->getCheck( 'curonly' );
7878 $rawOffset = $wgRequest->getVal( 'offset' );
Index: branches/phase3_rev_deleted/includes/SkinTemplate.php
@@ -179,7 +179,7 @@
180180
181181 $this->usercss = $this->userjs = $this->userjsprev = false;
182182 $this->setupUserCss();
183 - $this->setupUserJs();
 183+ $this->setupUserJs( $out->isUserJsAllowed() );
184184 $this->titletxt = $this->mTitle->getPrefixedText();
185185 wfProfileOut( "$fname-stuff" );
186186
@@ -591,7 +591,7 @@
592592 if( $selected ) {
593593 $classes[] = 'selected';
594594 }
595 - if( $checkEdit && $title->getArticleId() == 0 ) {
 595+ if( $checkEdit && !$title->isAlwaysKnown() && $title->getArticleId() == 0 ) {
596596 $classes[] = 'new';
597597 $query = 'action=edit';
598598 }
@@ -968,9 +968,12 @@
969969 # If we use the site's dynamic CSS, throw that in, too
970970 if ( $wgUseSiteCss ) {
971971 $query = "usemsgcache=yes&action=raw&ctype=text/css&smaxage=$wgSquidMaxage";
 972+ $skinquery = '';
 973+ if (($us = $wgRequest->getVal('useskin', '')) !== '')
 974+ $skinquery = "&useskin=$us";
972975 $sitecss .= '@import "' . self::makeNSUrl( 'Common.css', $query, NS_MEDIAWIKI) . '";' . "\n";
973976 $sitecss .= '@import "' . self::makeNSUrl( ucfirst( $this->skinname ) . '.css', $query, NS_MEDIAWIKI ) . '";' . "\n";
974 - $sitecss .= '@import "' . self::makeUrl( '-', 'action=raw&gen=css' . $siteargs ) . '";' . "\n";
 977+ $sitecss .= '@import "' . self::makeUrl( '-', "action=raw&gen=css$siteargs$skinquery" ) . '";' . "\n";
975978 }
976979
977980 # If we use any dynamic CSS, make a little CDATA block out of it.
@@ -984,14 +987,14 @@
985988 /**
986989 * @private
987990 */
988 - function setupUserJs() {
 991+ function setupUserJs( $allowUserJs ) {
989992 $fname = 'SkinTemplate::setupUserJs';
990993 wfProfileIn( $fname );
991994
992 - global $wgRequest, $wgAllowUserJs, $wgJsMimeType;
 995+ global $wgRequest, $wgJsMimeType;
993996 $action = $wgRequest->getText('action');
994997
995 - if( $wgAllowUserJs && $this->loggedin ) {
 998+ if( $allowUserJs && $this->loggedin ) {
996999 if( $this->mTitle->isJsSubpage() and $this->userCanPreview( $action ) ) {
9971000 # XXX: additional security check/prompt?
9981001 $this->userjsprev = '/*<![CDATA[*/ ' . $wgRequest->getText('wpTextbox1') . ' /*]]>*/';
Index: branches/phase3_rev_deleted/includes/SpecialPreferences.php
@@ -211,19 +211,23 @@
212212
213213 if ( '' != $this->mNewpass && $wgAuth->allowPasswordChange() ) {
214214 if ( $this->mNewpass != $this->mRetypePass ) {
 215+ wfRunHooks( "PrefsPasswordAudit", array( $wgUser, $this->mNewpass, 'badretype' ) );
215216 $this->mainPrefsForm( 'error', wfMsg( 'badretype' ) );
216217 return;
217218 }
218219
219220 if (!$wgUser->checkPassword( $this->mOldpass )) {
 221+ wfRunHooks( "PrefsPasswordAudit", array( $wgUser, $this->mNewpass, 'wrongpassword' ) );
220222 $this->mainPrefsForm( 'error', wfMsg( 'wrongpassword' ) );
221223 return;
222224 }
223225
224226 try {
225227 $wgUser->setPassword( $this->mNewpass );
 228+ wfRunHooks( "PrefsPasswordAudit", array( $wgUser, $this->mNewpass, 'success' ) );
226229 $this->mNewpass = $this->mOldpass = $this->mRetypePass = '';
227230 } catch( PasswordError $e ) {
 231+ wfRunHooks( "PrefsPasswordAudit", array( $wgUser, $this->mNewpass, 'error' ) );
228232 $this->mainPrefsForm( 'error', $e->getMessage() );
229233 return;
230234 }
@@ -321,6 +325,9 @@
322326 $wgUser->setCookies();
323327 $wgUser->saveSettings();
324328 }
 329+ if( $oldadr != $newadr ) {
 330+ wfRunHooks( "PrefsEmailAudit", array( $wgUser, $oldadr, $newadr ) );
 331+ }
325332 }
326333
327334 if( $needRedirect && $error === false ) {
@@ -489,6 +496,8 @@
490497 $wgOut->setArticleRelated( false );
491498 $wgOut->setRobotpolicy( 'noindex,nofollow' );
492499
 500+ $wgOut->disallowUserJs(); # Prevent hijacked user scripts from sniffing passwords etc.
 501+
493502 if ( $this->mSuccess || 'success' == $status ) {
494503 $wgOut->addWikitext( '<div class="successbox"><strong>'. wfMsg( 'savedprefs' ) . '</strong></div>' );
495504 } else if ( 'error' == $status ) {
@@ -657,15 +666,15 @@
658667 $this->tableRow( Xml::element( 'h2', null, wfMsg( 'changepassword' ) ) ) .
659668 $this->tableRow(
660669 Xml::label( wfMsg( 'oldpassword' ), 'wpOldpass' ),
661 - Xml::input( 'wpOldpass', 25, $this->mOldpass, array( 'id' => 'wpOldpass' ) )
 670+ Xml::password( 'wpOldpass', 25, $this->mOldpass, array( 'id' => 'wpOldpass' ) )
662671 ) .
663672 $this->tableRow(
664673 Xml::label( wfMsg( 'newpassword' ), 'wpNewpass' ),
665 - Xml::input( 'wpNewpass', 25, $this->mNewpass, array( 'id' => 'wpNewpass' ) )
 674+ Xml::password( 'wpNewpass', 25, $this->mNewpass, array( 'id' => 'wpNewpass' ) )
666675 ) .
667676 $this->tableRow(
668677 Xml::label( wfMsg( 'retypenew' ), 'wpRetypePass' ),
669 - Xml::input( 'wpRetypePass', 25, $this->mRetypePass, array( 'id' => 'wpRetypePass' ) )
 678+ Xml::password( 'wpRetypePass', 25, $this->mRetypePass, array( 'id' => 'wpRetypePass' ) )
670679 ) .
671680 Xml::tags( 'tr', null,
672681 Xml::tags( 'td', array( 'colspan' => '2' ),
Index: branches/phase3_rev_deleted/includes/DefaultSettings.php
@@ -1136,7 +1136,7 @@
11371137 * to ensure that client-side caches don't keep obsolete copies of global
11381138 * styles.
11391139 */
1140 -$wgStyleVersion = '64';
 1140+$wgStyleVersion = '67';
11411141
11421142
11431143 # Server-side caching:
@@ -1348,7 +1348,11 @@
13491349 /** Lots of debugging output from SquidUpdate.php */
13501350 $wgDebugSquid = false;
13511351
 1352+/** Whereas to count the number of time an article is viewed.
 1353+ * Does not work if pages are cached (for example with squid).
 1354+ */
13521355 $wgDisableCounters = false;
 1356+
13531357 $wgDisableTextSearch = false;
13541358 $wgDisableSearchContext = false;
13551359 /**
Index: branches/phase3_rev_deleted/includes/HttpFunctions.php
@@ -4,12 +4,20 @@
55 * Various HTTP related functions
66 */
77 class Http {
 8+ static function get( $url, $timeout = 'default' ) {
 9+ return Http::request( "GET", $url, $timeout );
 10+ }
 11+
 12+ static function post( $url, $timeout = 'default' ) {
 13+ return Http::request( "POST", $url, $timeout );
 14+ }
 15+
816 /**
917 * Get the contents of a file by HTTP
1018 *
1119 * if $timeout is 'default', $wgHTTPTimeout is used
1220 */
13 - static function get( $url, $timeout = 'default' ) {
 21+ static function request( $method, $url, $timeout = 'default' ) {
1422 global $wgHTTPTimeout, $wgHTTPProxy, $wgVersion, $wgTitle;
1523
1624 # Use curl if available
@@ -26,6 +34,10 @@
2735 }
2836 curl_setopt( $c, CURLOPT_TIMEOUT, $timeout );
2937 curl_setopt( $c, CURLOPT_USERAGENT, "MediaWiki/$wgVersion" );
 38+ if ( $method == 'POST' )
 39+ curl_setopt( $c, CURLOPT_POST, true );
 40+ else
 41+ curl_setopt( $c, CURLOPT_CUSTOMREQUEST, $method );
3042
3143 # Set the referer to $wgTitle, even in command-line mode
3244 # This is useful for interwiki transclusion, where the foreign
@@ -49,8 +61,12 @@
5062 } else {
5163 # Otherwise use file_get_contents, or its compatibility function from GlobalFunctions.php
5264 # This may take 3 minutes to time out, and doesn't have local fetch capabilities
 65+
 66+ $opts = array('http' => array( 'method' => $method ) );
 67+ $ctx = stream_context_create($opts);
 68+
5369 $url_fopen = ini_set( 'allow_url_fopen', 1 );
54 - $text = file_get_contents( $url );
 70+ $text = file_get_contents( $url, false, $ctx );
5571 ini_set( 'allow_url_fopen', $url_fopen );
5672 }
5773 return $text;
Index: branches/phase3_rev_deleted/includes/Block.php
@@ -438,9 +438,6 @@
439439 * @return bool Whether or not an autoblock was inserted.
440440 */
441441 function doAutoblock( $autoblockip, $justInserted = false ) {
442 - # Check if this IP address is already blocked
443 - $dbw = wfGetDB( DB_MASTER );
444 -
445442 # If autoblocks are disabled, go away.
446443 if ( !$this->mEnableAutoblock ) {
447444 return;
Index: branches/phase3_rev_deleted/includes/QueryPage.php
@@ -332,7 +332,6 @@
333333 $num = $dbr->numRows($res);
334334
335335 $this->preprocessResults( $dbr, $res );
336 - $sk = $wgUser->getSkin();
337336
338337 # Top header and navigation
339338 if( $shownavigation ) {
Index: branches/phase3_rev_deleted/includes/Skin.php
@@ -334,8 +334,8 @@
335335 return self::makeVariablesScript( $vars );
336336 }
337337
338 - function getHeadScripts() {
339 - global $wgStylePath, $wgUser, $wgAllowUserJs, $wgJsMimeType, $wgStyleVersion;
 338+ function getHeadScripts( $allowUserJs ) {
 339+ global $wgStylePath, $wgUser, $wgJsMimeType, $wgStyleVersion;
340340
341341 $r = self::makeGlobalVariablesScript( array( 'skinname' => $this->getSkinName() ) );
342342
@@ -348,7 +348,7 @@
349349 $r .= "<script type=\"$wgJsMimeType\" src=\"".htmlspecialchars(self::makeUrl('-','action=raw&gen=js'))."\"><!-- site js --></script>\n";
350350 }
351351 }
352 - if( $wgAllowUserJs && $wgUser->isLoggedIn() ) {
 352+ if( $allowUserJs && $wgUser->isLoggedIn() ) {
353353 $userpage = $wgUser->getUserPage();
354354 $userjs = htmlspecialchars( self::makeUrl(
355355 $userpage->getPrefixedText().'/'.$this->getSkinName().'.js',
Index: branches/phase3_rev_deleted/includes/SpecialListusers.php
@@ -103,7 +103,6 @@
104104 $this->doQuery();
105105 }
106106 $batch = new LinkBatch;
107 - $db = $this->mDb;
108107
109108 $this->mResult->rewind();
110109
Index: branches/phase3_rev_deleted/includes/Pager.php
@@ -72,17 +72,18 @@
7373 public $mResult;
7474
7575 function __construct() {
76 - global $wgRequest;
 76+ global $wgRequest, $wgUser;
7777 $this->mRequest = $wgRequest;
78 -
 78+
7979 # NB: the offset is quoted, not validated. It is treated as an arbitrary string
8080 # to support the widest variety of index types. Be careful outputting it into
8181 # HTML!
8282 $this->mOffset = $this->mRequest->getText( 'offset' );
83 - $this->mLimit = $this->mRequest->getInt( 'limit', $this->mDefaultLimit );
84 - if ( $this->mLimit <= 0 || $this->mLimit > 50000 ) {
85 - $this->mLimit = $this->mDefaultLimit;
86 - }
 83+
 84+ # Use consistent behavior for the limit options
 85+ $this->mDefaultLimit = intval( $wgUser->getOption( 'rclimit' ) );
 86+ list( $this->mLimit, /* $offset */ ) = $this->mRequest->getLimitOffset();
 87+
8788 $this->mIsBackwards = ( $this->mRequest->getVal( 'dir' ) == 'prev' );
8889 $this->mIndexField = $this->getIndexField();
8990 $this->mDb = wfGetDB( DB_SLAVE );
Index: branches/phase3_rev_deleted/includes/Database.php
@@ -582,7 +582,7 @@
583583 @/**/$this->mConn = mysql_connect( $server, $user, $password, true );
584584 }
585585 if ($this->mConn === false) {
586 - $iplus = $i + 1;
 586+ #$iplus = $i + 1;
587587 #wfLogDBError("Connect loop error $iplus of $max ($server): " . mysql_errno() . " - " . mysql_error()."\n");
588588 }
589589 }
Index: branches/phase3_rev_deleted/languages/messages/MessagesEn.php
@@ -22,13 +22,13 @@
2323 * is English by default, for all files other than this one.
2424 *
2525 * Do NOT set this to false in any other message file! Leave the line out to
26 - * accept the default fallback to "en".
 26+ * accept the default fallback to "en".
2727 */
2828 $fallback = false;
2929
3030 /**
3131 * Is the language written right-to-left?
32 - * Note that right-to-left languages generally also specify
 32+ * Note that right-to-left languages generally also specify
3333 * $defaultUserOptionOverrides = array( 'quickbar' => 2 );
3434 */
3535 $rtl = false;
@@ -49,17 +49,17 @@
5050 $defaultUserOptionOverrides = array();
5151
5252 /**
53 - * Extra user preferences which will be shown in Special:Preferences as
54 - * checkboxes. Extra settings in derived languages will automatically be
 53+ * Extra user preferences which will be shown in Special:Preferences as
 54+ * checkboxes. Extra settings in derived languages will automatically be
5555 * appended to the array of the fallback languages.
5656 */
5757 $extraUserToggles = array();
5858
5959 /**
60 - * URLs do not specify their encoding. UTF-8 is used by default, but if the
 60+ * URLs do not specify their encoding. UTF-8 is used by default, but if the
6161 * URL is not a valid UTF-8 sequence, we have to try to guess what the real
6262 * encoding is. The encoding used in this case is defined below, and must be
63 - * supported by iconv().
 63+ * supported by iconv().
6464 */
6565 $fallback8bitEncoding = 'windows-1252';
6666
@@ -69,20 +69,20 @@
7070 $linkPrefixExtension = false;
7171
7272 /**
73 - * Namespace names. NS_PROJECT is always set to $wgMetaNamespace after the
74 - * settings are loaded, it will be ignored even if you specify it here.
 73+ * Namespace names. NS_PROJECT is always set to $wgMetaNamespace after the
 74+ * settings are loaded, it will be ignored even if you specify it here.
7575 *
7676 * NS_PROJECT_TALK will be set to $wgMetaNamespaceTalk if that variable is
77 - * set, otherwise the string specified here will be used. The string may
78 - * contain "$1", which will be replaced by the name of NS_PROJECT. It may
79 - * also contain a grammatical transformation, e.g.
 77+ * set, otherwise the string specified here will be used. The string may
 78+ * contain "$1", which will be replaced by the name of NS_PROJECT. It may
 79+ * also contain a grammatical transformation, e.g.
8080 *
8181 * NS_PROJECT_TALK => 'Keskustelu_{{grammar:elative|$1}}'
8282 *
83 - * Only one grammatical transform may be specified in the string. For
84 - * performance reasons, this transformation is done locally by the language
85 - * module rather than by the full wikitext parser. As a result, no other
86 - * parser features are available.
 83+ * Only one grammatical transform may be specified in the string. For
 84+ * performance reasons, this transformation is done locally by the language
 85+ * module rather than by the full wikitext parser. As a result, no other
 86+ * parser features are available.
8787 */
8888 $namespaceNames = array(
8989 NS_MEDIA => 'Media',
@@ -137,12 +137,12 @@
138138 );
139139
140140 /**
141 - * A list of date format preference keys which can be selected in user
 141+ * A list of date format preference keys which can be selected in user
142142 * preferences. New preference keys can be added, provided they are supported
143 - * by the language class's timeanddate(). Only the 5 keys listed below are
 143+ * by the language class's timeanddate(). Only the 5 keys listed below are
144144 * supported by the wikitext converter (DateFormatter.php).
145145 *
146 - * The special key "default" is an alias for either dmy or mdy depending on
 146+ * The special key "default" is an alias for either dmy or mdy depending on
147147 * $wgAmericanDates
148148 */
149149 $datePreferences = array(
@@ -155,14 +155,14 @@
156156
157157 /**
158158 * The date format to use for generated dates in the user interface.
159 - * This may be one of the above date preferences, or the special value
160 - * "dmy or mdy", which uses mdy if $wgAmericanDates is true, and dmy
 159+ * This may be one of the above date preferences, or the special value
 160+ * "dmy or mdy", which uses mdy if $wgAmericanDates is true, and dmy
161161 * if $wgAmericanDates is false.
162162 */
163163 $defaultDateFormat = 'dmy or mdy';
164164
165165 /**
166 - * Associative array mapping old numeric date formats, which may still be
 166+ * Associative array mapping old numeric date formats, which may still be
167167 * stored in user preferences, to the new string formats.
168168 */
169169 $datePreferenceMigrationMap = array(
@@ -174,8 +174,8 @@
175175
176176 /**
177177 * These are formats for dates generated by MediaWiki (as opposed to the wikitext
178 - * DateFormatter). Documentation for the format string can be found in
179 - * Language.php, search for sprintfDate.
 178+ * DateFormatter). Documentation for the format string can be found in
 179+ * Language.php, search for sprintfDate.
180180 *
181181 * This array is automatically inherited by all subclasses. Individual keys can be
182182 * overridden.
@@ -341,11 +341,11 @@
342342
343343 /**
344344 * Alternate names of special pages. All names are case-insensitive. The first
345 - * listed alias will be used as the default. Aliases from the fallback
346 - * localisation (usually English) will be included by default.
347 - *
348 - * This array may be altered at runtime using the LangugeGetSpecialPageAliases
349 - * hook.
 345+ * listed alias will be used as the default. Aliases from the fallback
 346+ * localisation (usually English) will be included by default.
 347+ *
 348+ * This array may be altered at runtime using the LangugeGetSpecialPageAliases
 349+ * hook.
350350 */
351351 $specialPageAliases = array(
352352 'DoubleRedirects' => array( 'DoubleRedirects' ),
@@ -421,7 +421,7 @@
422422 );
423423
424424 /**
425 - * Regular expression matching the "link trail", e.g. "ed" in [[Toast]]ed, as
 425+ * Regular expression matching the "link trail", e.g. "ed" in [[Toast]]ed, as
426426 * the first group, and the remainder of the string as the second group.
427427 */
428428 $linkTrail = '/^([a-z]+)(.*)$/sD';
@@ -663,7 +663,7 @@
664664 'redirectedfrom' => '(Redirected from $1)',
665665 'redirectpagesub' => 'Redirect page',
666666 'lastmodifiedat' => 'This page was last modified $2, $1.', //$1 date, $2 time
667 -'viewcount' => 'This page has been accessed {{plural:$1|one time|$1 times}}.',
 667+'viewcount' => 'This page has been accessed {{PLURAL:$1|one time|$1 times}}.',
668668 'copyright' => 'Content is available under $1.',
669669 'protectedpage' => 'Protected page',
670670 'jumpto' => 'Jump to:',
@@ -799,11 +799,11 @@
800800 Your account has been created. Don't forget to change your {{SITENAME}} preferences.",
801801
802802 'loginpagetitle' => 'User login',
803 -'yourname' => 'Username',
804 -'yourpassword' => 'Password',
805 -'yourpasswordagain' => 'Retype password',
 803+'yourname' => 'Username:',
 804+'yourpassword' => 'Password:',
 805+'yourpasswordagain' => 'Retype password:',
806806 'remembermypassword' => 'Remember my login on this computer',
807 -'yourdomainname' => 'Your domain',
 807+'yourdomainname' => 'Your domain:',
808808 'externaldberror' => 'There was either an external authentication database error or you are not allowed to update your external account.',
809809 'loginproblem' => '<b>There has been a problem with your login.</b><br />Try again!',
810810 'alreadyloggedin' => "<strong>User $1, you are already logged in!</strong><br />",
@@ -831,10 +831,9 @@
832832 'yournick' => 'Nickname:',
833833 'badsig' => 'Invalid raw signature; check HTML tags.',
834834 'email' => 'E-mail',
835 -'prefs-help-email-enotif' => 'This address is also used to send you e-mail notifications if you enabled the options.',
836 -'prefs-help-realname' => 'Optional: if you choose to provide it this will be used for giving you attribution for your work.',
 835+'prefs-help-realname' => 'Real name is optional and if you choose to provide it this will be used for giving you attribution for your work.',
837836 'loginerror' => 'Login error',
838 -'prefs-help-email' => 'Optional: Enables others to contact you through your user or user_talk page without needing to reveal your identity.',
 837+'prefs-help-email' => 'E-mail address is optional, but it enables others to contact you through your user or user_talk page without needing to reveal your identity.',
839838 'nocookiesnew' => 'The user account was created, but you are not logged in. {{SITENAME}} uses cookies to log in users. You have cookies disabled. Please enable them, then log in with your new username and password.',
840839 'nocookieslogin' => '{{SITENAME}} uses cookies to log in users. You have cookies disabled. Please enable them and try again.',
841840 'noname' => 'You have not specified a valid user name.',
@@ -1028,7 +1027,7 @@
10291028 'longpagewarning' => "<strong>WARNING: This page is $1 kilobytes long; some
10301029 browsers may have problems editing pages approaching or longer than 32kb.
10311030 Please consider breaking the page into smaller sections.</strong>",
1032 -'longpageerror' => "<strong>ERROR: The text you have submitted is $1 kilobytes
 1031+'longpageerror' => "<strong>ERROR: The text you have submitted is $1 kilobytes
10331032 long, which is longer than the maximum of $2 kilobytes. It cannot be saved.</strong>",
10341033 'readonlywarning' => '<strong>WARNING: The database has been locked for maintenance,
10351034 so you will not be able to save your edits right now. You may wish to cut-n-paste
@@ -1053,8 +1052,8 @@
10541053
10551054 # Account creation failure
10561055 'cantcreateaccounttitle' => 'Can\'t create account',
1057 -'cantcreateaccounttext' => 'Account creation from this IP address (<b>$1</b>) has been blocked.
1058 -This is probably due to persistent vandalism from your school or Internet service
 1056+'cantcreateaccounttext' => 'Account creation from this IP address (<b>$1</b>) has been blocked.
 1057+This is probably due to persistent vandalism from your school or Internet service
10591058 provider.',
10601059
10611060 # History pages
@@ -1137,8 +1136,8 @@
11381137 'revdelete-submit' => 'Apply to selected revision',
11391138 'revdelete-logentry' => 'changed revision visibility of [[$1]]',
11401139 'logdelete-logentry' => 'changed event visibility of [[$1]]',
1141 -'revdelete-logaction' => '$1 {{plural:$1|revision|revisions}} set to mode $2',
1142 -'logdelete-logaction' => '$1 {{plural:$1|event|events}} to [[$3]] set to mode $2',
 1140+'revdelete-logaction' => '$1 {{PLURAL:$1|revision|revisions}} set to mode $2',
 1141+'logdelete-logaction' => '$1 {{PLURAL:$1|event|events}} to [[$3]] set to mode $2',
11431142 'revdelete-success' => 'Revision visibility successfully set.',
11441143 'logdelete-success' => 'Event visibility successfully set.',
11451144
@@ -1165,7 +1164,7 @@
11661165 'selectolderversionfordiff' => 'Select an older version for comparison',
11671166 'compareselectedversions' => 'Compare selected versions',
11681167 'editundo' => 'undo',
1169 -'diff-multi' => "({{plural:$1|One intermediate revision|$1 intermediate revisions}} not shown.)",
 1168+'diff-multi' => "({{PLURAL:$1|One intermediate revision|$1 intermediate revisions}} not shown.)",
11701169
11711170 # Search results
11721171 #
@@ -1444,7 +1443,7 @@
14451444 #
14461445 'imagelist' => 'File list',
14471446 'imagelist-summary' => '',
1448 -'imagelisttext' => "Below is a list of '''$1''' {{plural:$1|file|files}} sorted $2.",
 1447+'imagelisttext' => "Below is a list of '''$1''' {{PLURAL:$1|file|files}} sorted $2.",
14491448 'imagelistforuser' => "This shows only images uploaded by $1.",
14501449 'getimagelist' => 'fetching file list',
14511450 'ilsubmit' => 'Search',
@@ -1514,7 +1513,7 @@
15151514 This includes \"talk\" pages, pages about {{SITENAME}}, minimal \"stub\"
15161515 pages, redirects, and others that probably don't qualify as content pages.
15171516 Excluding those, there {{PLURAL:$2|is '''1''' page that is a|are '''$2''' pages that are}} probably legitimate
1518 -content {{PLURAL:$2|page|pages}}.
 1517+content {{PLURAL:$2|page|pages}}.
15191518
15201519 '''$8''' {{PLURAL:$8|file|files}} have been uploaded.
15211520
@@ -1893,8 +1892,8 @@
18941893 use the navigation links.",
18951894 'undeleterevisions' => "$1 {{PLURAL:$1|revision|revisions}} archived",
18961895 'undeletehistory' => 'If you restore the page, these revisions will be restored to the page history.
1897 -If a new page with the same name has been created since the deletion, the restored
1898 -revisions will appear in the prior history.',
 1896+If a new page with the same name has been created since the deletion, the restored revisions will appear
 1897+in the prior history.',
18991898 'undeleterevdel' => 'Undeletion will not be performed if either it would result in the top page or image revision
19001899 being restricted or it would result in an alternating page history between these and any live revisions for this page. ',
19011900 'restorepoint' => 'Use the radio button column to restore only revisions from the specified time onwards.',
@@ -1909,14 +1908,14 @@
19101909 'undeletereset' => 'Reset',
19111910 'undeletecomment' => 'Comment:',
19121911 'undeletedarticle' => "restored \"[[$1]]\"",
1913 -'undeletedrevisions' => "$1 {{plural:$1|revision|revisions}} restored",
1914 -'undeletedrevisions-files' => "$1 {{plural:$1|revision|revisions}} and $2 {{plural:$2|file|files}} restored",
1915 -'undeletedfiles' => "$1 {{plural:$1|file|files}} restored",
 1912+'undeletedrevisions' => "$1 {{PLURAL:$1|revision|revisions}} restored",
 1913+'undeletedrevisions-files' => "$1 {{PLURAL:$1|revision|revisions}} and $2 {{PLURAL:$2|file|files}} restored",
 1914+'undeletedfiles' => "$1 {{PLURAL:$1|file|files}} restored",
19161915 'cannotundelete' => 'Undelete failed; someone else may have undeleted the page first.',
19171916 'undeletedpage' => "<big>'''$1 has been restored'''</big>
19181917
19191918 Consult the [[Special:Log/delete|deletion log]] for a record of recent deletions and restorations.",
1920 -'undelete-header' => 'See [[Special:Log/delete|the deletion log]] for recently deleted pages.',
 1919+'undelete-header' => 'See [[Special:Log/delete|the deletion log]] for recently deleted pages or revisions.',
19211920 'undelete-search-box' => 'Search deleted pages',
19221921 'undelete-search-prefix' => 'Show pages starting with:',
19231922 'undelete-search-submit' => 'Search',
@@ -1977,10 +1976,10 @@
19781977 accordance with [[{{MediaWiki:policy-url}}|policy]].
19791978 Fill in a specific reason below (for example, citing particular
19801979 pages that were vandalized).",
1981 -'ipaddress' => 'IP Address',
1982 -'ipadressorusername' => 'IP Address or username',
1983 -'ipbexpiry' => 'Expiry',
1984 -'ipbreason' => 'Reason',
 1980+'ipaddress' => 'IP Address:',
 1981+'ipadressorusername' => 'IP Address or username:',
 1982+'ipbexpiry' => 'Expiry:',
 1983+'ipbreason' => 'Reason:',
19851984 'ipbreasonotherlist' => 'Other reason',
19861985
19871986 // These are examples only. They can be translated but should be adjusted via
@@ -2002,10 +2001,10 @@
20032002 'ipbcreateaccount' => 'Prevent account creation',
20042003 'ipbenableautoblock' => 'Automatically block the last IP address used by this user, and any subsequent IPs they try to edit from',
20052004 'ipbsubmit' => 'Block this user',
2006 -'ipbother' => 'Other time',
 2005+'ipbother' => 'Other time:',
20072006 'ipboptions' => '2 hours:2 hours,1 day:1 day,3 days:3 days,1 week:1 week,2 weeks:2 weeks,1 month:1 month,3 months:3 months,6 months:6 months,1 year:1 year,infinite:infinite',
20082007 'ipbotheroption' => 'other',
2009 -'ipbotherreason' => 'Other/additional reason',
 2008+'ipbotherreason' => 'Other/additional reason:',
20102009 'ipbhidename' => 'Hide username/IP from the block log, active block list and user list',
20112010 'badipaddress' => 'Invalid IP address',
20122011 'blockipsuccesssub' => 'Block succeeded',
@@ -2031,7 +2030,8 @@
20322031 'anononlyblock' => 'anon. only',
20332032 'noautoblockblock' => 'autoblock disabled',
20342033 'createaccountblock' => 'account creation blocked',
2035 -'ipblocklistempty' => 'The blocklist is empty or the requested IP address/username is not blocked.',
 2034+'ipblocklist-empty' => 'The blocklist is empty.',
 2035+'ipblocklist-no-results' => 'The requested IP address or username is not blocked.',
20362036 'blocklink' => 'block',
20372037 'unblocklink' => 'unblock',
20382038 'contribslink' => 'contribs',
@@ -2258,6 +2258,8 @@
22592259 'accesskey-feed-atom' => '',
22602260 'accesskey-t-contributions' => '',
22612261 'accesskey-t-emailuser' => '',
 2262+'accesskey-t-permalink' => '',
 2263+'accesskey-t-print' => 'p',
22622264 'accesskey-t-upload' => 'u',
22632265 'accesskey-t-specialpages' => 'q',
22642266 'accesskey-ca-nstab-main' => 'c',
@@ -2316,6 +2318,8 @@
23172319 'tooltip-t-emailuser' => 'Send a mail to this user',
23182320 'tooltip-t-upload' => 'Upload images or media files',
23192321 'tooltip-t-specialpages' => 'List of all special pages',
 2322+'tooltip-t-print' => 'Printable version of this page',
 2323+'tooltip-t-permalink' => 'Permanent link to this version of the page',
23202324 'tooltip-ca-nstab-main' => 'View the content page',
23212325 'tooltip-ca-nstab-user' => 'View the user page',
23222326 'tooltip-ca-nstab-media' => 'View the media page',