r78437 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78436‎ | r78437 | r78438 >
Date:14:14, 15 December 2010
Author:catrope
Status:ok
Tags:
Comment:
Modified paths:
  • /branches/REL1_17/phase3/RELEASE-NOTES (modified) (history)
  • /branches/REL1_17/phase3/api.php (modified) (history)
  • /branches/REL1_17/phase3/includes/AutoLoader.php (modified) (history)
  • /branches/REL1_17/phase3/includes/Block.php (modified) (history)
  • /branches/REL1_17/phase3/includes/DefaultSettings.php (modified) (history)
  • /branches/REL1_17/phase3/includes/EditPage.php (modified) (history)
  • /branches/REL1_17/phase3/includes/HTMLForm.php (modified) (history)
  • /branches/REL1_17/phase3/includes/Preferences.php (modified) (history)
  • /branches/REL1_17/phase3/includes/SpecialPage.php (modified) (history)
  • /branches/REL1_17/phase3/includes/Status.php (modified) (history)
  • /branches/REL1_17/phase3/includes/WebRequest.php (modified) (history)
  • /branches/REL1_17/phase3/includes/api/ApiPatrol.php (modified) (history)
  • /branches/REL1_17/phase3/includes/api/ApiQueryInfo.php (modified) (history)
  • /branches/REL1_17/phase3/includes/api/ApiQueryRecentChanges.php (modified) (history)
  • /branches/REL1_17/phase3/includes/diff/DifferenceEngine.php (modified) (history)
  • /branches/REL1_17/phase3/includes/installer/CoreInstaller.php (modified) (history)
  • /branches/REL1_17/phase3/includes/installer/Installer.i18n.php (modified) (history)
  • /branches/REL1_17/phase3/includes/installer/Installer.php (modified) (history)
  • /branches/REL1_17/phase3/includes/installer/LocalSettingsGenerator.php (modified) (history)
  • /branches/REL1_17/phase3/includes/installer/WebInstaller.php (modified) (history)
  • /branches/REL1_17/phase3/includes/installer/WebInstallerPage.php (modified) (history)
  • /branches/REL1_17/phase3/includes/specials/SpecialEmailuser.php (modified) (history)
  • /branches/REL1_17/phase3/includes/specials/SpecialListgrouprights.php (modified) (history)
  • /branches/REL1_17/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /branches/REL1_17/phase3/languages/messages/MessagesQqq.php (modified) (history)
  • /branches/REL1_17/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: branches/REL1_17/phase3/maintenance/language/messages.inc
@@ -565,6 +565,8 @@
566566 'userjsyoucanpreview',
567567 'usercsspreview',
568568 'userjspreview',
 569+ 'sitecsspreview',
 570+ 'sitejspreview',
569571 'userinvalidcssjstitle',
570572 'updated',
571573 'note',
Index: branches/REL1_17/phase3/includes/diff/DifferenceEngine.php
@@ -1013,7 +1013,7 @@
10141014 'undo' => $this->mNewid
10151015 ) );
10161016 $htmlLink = htmlspecialchars( wfMsg( 'editundo' ) );
1017 - $htmlTitle = $wgUser->getSkin()->titleAttrib( 'undo' );
 1017+ $htmlTitle = Xml::expandAttributes( array( 'title' => $wgUser->getSkin()->titleAttrib( 'undo' ) ) );
10181018 if ( $editable && !$this->mOldRev->isDeleted( Revision::DELETED_TEXT ) && !$this->mNewRev->isDeleted( Revision::DELETED_TEXT ) ) {
10191019 $this->mNewtitle .= " (<a href='$newUndo' $htmlTitle>" . $htmlLink . "</a>)";
10201020 }
Index: branches/REL1_17/phase3/includes/Status.php
@@ -301,6 +301,23 @@
302302 }
303303
304304 /**
 305+ * If the specified source message exists, replace it with the specified
 306+ * destination message, but keep the same parameters as in the original error.
 307+ *
 308+ * Return true if the replacement was done, false otherwise.
 309+ */
 310+ function replaceMessage( $source, $dest ) {
 311+ $replaced = false;
 312+ foreach ( $this->errors as $index => $error ) {
 313+ if ( $error['message'] === $source ) {
 314+ $this->errors[$index]['message'] = $dest;
 315+ $replaced = true;
 316+ }
 317+ }
 318+ return $replaced;
 319+ }
 320+
 321+ /**
305322 * Backward compatibility function for WikiError -> Status migration
306323 *
307324 * @return String
Index: branches/REL1_17/phase3/includes/EditPage.php
@@ -1223,7 +1223,7 @@
12241224 if ( $this->showHeader() === false )
12251225 return;
12261226
1227 - $action = htmlspecialchars($this->getActionURL($wgTitle));
 1227+ $action = htmlspecialchars( $this->getActionURL( $wgTitle ) );
12281228
12291229 if ( $wgUser->getOption( 'showtoolbar' ) and !$this->isCssJsSubpage ) {
12301230 # prepare toolbar for edit buttons
@@ -1878,17 +1878,30 @@
18791879 }
18801880
18811881 # don't parse user css/js, show message about preview
1882 - # XXX: stupid php bug won't let us use $wgTitle->isCssJsSubpage() here
 1882+ # XXX: stupid php bug won't let us use $wgTitle->isCssJsSubpage() here -- This note has been there since r3530. Sure the bug was fixed time ago?
18831883
1884 - if ( $this->isCssJsSubpage ) {
 1884+ if ( $this->isCssJsSubpage || $this->mTitle->isCssOrJsPage() ) {
 1885+ $level = 'user';
 1886+ if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
 1887+ $level = 'site';
 1888+ }
 1889+
 1890+ # Used messages to make sure grep find them:
 1891+ # Messages: usercsspreview, userjspreview, sitecsspreview, sitejspreview
18851892 if (preg_match( "/\\.css$/", $this->mTitle->getText() ) ) {
1886 - $previewtext = "<div id='mw-usercsspreview'>\n" . wfMsg( 'usercsspreview' ) . "\n</div>";
1887 - } else if (preg_match( "/\\.js$/", $this->mTitle->getText() ) ) {
1888 - $previewtext = "<div id='mw-userjspreview'>\n" . wfMsg( 'userjspreview' ) . "\n</div>";
 1893+ $previewtext = "<div id='mw-{$level}csspreview'>\n" . wfMsg( "{$level}csspreview" ) . "\n</div>";
 1894+ $class = "mw-code mw-css";
 1895+ } elseif (preg_match( "/\\.js$/", $this->mTitle->getText() ) ) {
 1896+ $previewtext = "<div id='mw-{$level}jspreview'>\n" . wfMsg( "{$level}jspreview" ) . "\n</div>";
 1897+ $class = "mw-code mw-js";
 1898+ } else {
 1899+ throw new MWException( 'A CSS/JS (sub)page but which is not css nor js!' );
18891900 }
 1901+
18901902 $parserOptions->setTidy( true );
18911903 $parserOutput = $wgParser->parse( $previewtext, $this->mTitle, $parserOptions );
18921904 $previewHTML = $parserOutput->mText;
 1905+ $previewHTML .= "<pre class=\"$class\" dir=\"ltr\">\n" . htmlspecialchars( $this->textbox1 ) . "\n</pre>\n";
18931906 } else {
18941907 $rt = Title::newFromRedirectArray( $this->textbox1 );
18951908 if ( $rt ) {
@@ -2342,7 +2355,9 @@
23432356 );
23442357 $checkboxes['minor'] =
23452358 Xml::check( 'wpMinoredit', $checked['minor'], $attribs ) .
2346 - "&#160;<label for='wpMinoredit' id='mw-editpage-minoredit'" . $skin->titleAttrib( 'minoredit', 'withaccess' ) . ">{$minorLabel}</label>";
 2359+ "&#160;<label for='wpMinoredit' id='mw-editpage-minoredit'" .
 2360+ Xml::expandAttributes( array( 'title' => $skin->titleAttrib( 'minoredit', 'withaccess' ) ) ) .
 2361+ ">{$minorLabel}</label>";
23472362 }
23482363
23492364 $watchLabel = wfMsgExt( 'watchthis', array( 'parseinline' ) );
@@ -2355,7 +2370,9 @@
23562371 );
23572372 $checkboxes['watch'] =
23582373 Xml::check( 'wpWatchthis', $checked['watch'], $attribs ) .
2359 - "&#160;<label for='wpWatchthis' id='mw-editpage-watch'" . $skin->titleAttrib( 'watch', 'withaccess' ) . ">{$watchLabel}</label>";
 2374+ "&#160;<label for='wpWatchthis' id='mw-editpage-watch'" .
 2375+ Xml::expandAttributes( array( 'title' => $skin->titleAttrib( 'watch', 'withaccess' ) ) ) .
 2376+ ">{$watchLabel}</label>";
23602377 }
23612378 wfRunHooks( 'EditPageBeforeEditChecks', array( &$this, &$checkboxes, &$tabindex ) );
23622379 return $checkboxes;
Index: branches/REL1_17/phase3/includes/HTMLForm.php
@@ -16,32 +16,32 @@
1717 * The constructor input is an associative array of $fieldname => $info,
1818 * where $info is an Associative Array with any of the following:
1919 *
20 - * 'class' -- the subclass of HTMLFormField that will be used
21 - * to create the object. *NOT* the CSS class!
22 - * 'type' -- roughly translates into the <select> type attribute.
23 - * if 'class' is not specified, this is used as a map
24 - * through HTMLForm::$typeMappings to get the class name.
25 - * 'default' -- default value when the form is displayed
26 - * 'id' -- HTML id attribute
27 - * 'cssclass' -- CSS class
28 - * 'options' -- varies according to the specific object.
29 - * 'label-message' -- message key for a message to use as the label.
30 - * can be an array of msg key and then parameters to
31 - * the message.
32 - * 'label' -- alternatively, a raw text message. Overridden by
33 - * label-message
34 - * 'help-message' -- message key for a message to use as a help text.
35 - * can be an array of msg key and then parameters to
36 - * the message.
37 - * 'required' -- passed through to the object, indicating that it
38 - * is a required field.
39 - * 'size' -- the length of text fields
40 - * 'filter-callback -- a function name to give you the chance to
41 - * massage the inputted value before it's processed.
42 - * @see HTMLForm::filter()
43 - * 'validation-callback' -- a function name to give you the chance
44 - * to impose extra validation on the field input.
45 - * @see HTMLForm::validate()
 20+ * 'class' -- the subclass of HTMLFormField that will be used
 21+ * to create the object. *NOT* the CSS class!
 22+ * 'type' -- roughly translates into the <select> type attribute.
 23+ * if 'class' is not specified, this is used as a map
 24+ * through HTMLForm::$typeMappings to get the class name.
 25+ * 'default' -- default value when the form is displayed
 26+ * 'id' -- HTML id attribute
 27+ * 'cssclass' -- CSS class
 28+ * 'options' -- varies according to the specific object.
 29+ * 'label-message' -- message key for a message to use as the label.
 30+ * can be an array of msg key and then parameters to
 31+ * the message.
 32+ * 'label' -- alternatively, a raw text message. Overridden by
 33+ * label-message
 34+ * 'help-message' -- message key for a message to use as a help text.
 35+ * can be an array of msg key and then parameters to
 36+ * the message.
 37+ * 'required' -- passed through to the object, indicating that it
 38+ * is a required field.
 39+ * 'size' -- the length of text fields
 40+ * 'filter-callback -- a function name to give you the chance to
 41+ * massage the inputted value before it's processed.
 42+ * @see HTMLForm::filter()
 43+ * 'validation-callback' -- a function name to give you the chance
 44+ * to impose extra validation on the field input.
 45+ * @see HTMLForm::validate()
4646 *
4747 * TODO: Document 'section' / 'subsection' stuff
4848 */
@@ -187,10 +187,10 @@
188188 * The here's-one-I-made-earlier option: do the submission if
189189 * posted, or display the form with or without funky valiation
190190 * errors
191 - * @return Bool whether submission was successful.
 191+ * @return Bool or Status whether submission was successful.
192192 */
193193 function show() {
194 - // Check if we have the info we need
 194+ # Check if we have the info we need
195195 if ( ! $this->mTitle ) {
196196 throw new MWException( "You must call setTitle() on an HTMLForm" );
197197 }
@@ -209,9 +209,7 @@
210210 $result = $this->trySubmit();
211211 }
212212
213 - if ( $result === true ||
214 - ( $result instanceof Status && $result->isGood() ) )
215 - {
 213+ if ( $result === true || ( $result instanceof Status && $result->isGood() ) ){
216214 return $result;
217215 }
218216
@@ -708,6 +706,10 @@
709707 return call_user_func( $this->mValidationCallback, $value, $alldata );
710708 }
711709
 710+ if ( isset( $this->mParams['required'] ) && $value === '' ) {
 711+ return wfMsgExt( 'htmlform-required', 'parseinline' );
 712+ }
 713+
712714 return true;
713715 }
714716
@@ -1001,20 +1003,6 @@
10021004
10031005 return Html::element( 'input', $attribs );
10041006 }
1005 -
1006 - public function validate( $value, $alldata ) {
1007 - $p = parent::validate( $value, $alldata );
1008 -
1009 - if ( $p !== true ) {
1010 - return $p;
1011 - }
1012 -
1013 - if ( isset( $this->mParams['required'] ) && $value === '' ) {
1014 - return wfMsgExt( 'htmlform-required', 'parseinline' );
1015 - }
1016 -
1017 - return true;
1018 - }
10191007 }
10201008 class HTMLTextAreaField extends HTMLFormField {
10211009 function getCols() {
@@ -1054,20 +1042,6 @@
10551043
10561044 return Html::element( 'textarea', $attribs, $value );
10571045 }
1058 -
1059 - public function validate( $value, $alldata ) {
1060 - $p = parent::validate( $value, $alldata );
1061 -
1062 - if ( $p !== true ) {
1063 - return $p;
1064 - }
1065 -
1066 - if ( isset( $this->mParams['required'] ) && $value === '' ) {
1067 - return wfMsgExt( 'htmlform-required', 'parseinline' );
1068 - }
1069 -
1070 - return true;
1071 - }
10721046 }
10731047
10741048 /**
@@ -1086,8 +1060,12 @@
10871061 if ( $p !== true ) {
10881062 return $p;
10891063 }
 1064+
 1065+ $value = trim( $value );
10901066
1091 - if ( floatval( $value ) != $value ) {
 1067+ # http://dev.w3.org/html5/spec/common-microsyntaxes.html#real-numbers
 1068+ # with the addition that a leading '+' sign is ok.
 1069+ if ( !preg_match( '/^(\+|\-)?\d+(\.\d+)?(E(\+|\-)?\d+)?$/i', $value ) ) {
10921070 return wfMsgExt( 'htmlform-float-invalid', 'parse' );
10931071 }
10941072
@@ -1124,8 +1102,13 @@
11251103 return $p;
11261104 }
11271105
1128 - if ( $value !== ''
1129 - && ( !is_numeric( $value ) || round( $value ) != $value )
 1106+ # http://dev.w3.org/html5/spec/common-microsyntaxes.html#signed-integers
 1107+ # with the addition that a leading '+' sign is ok. Note that leading zeros
 1108+ # are fine, and will be left in the input, which is useful for things like
 1109+ # phone numbers when you know that they are integers (the HTML5 type=tel
 1110+ # input does not require its value to be numeric). If you want a tidier
 1111+ # value to, eg, save in the DB, clean it up with intval().
 1112+ if ( !preg_match( '/^(\+|\-)?\d*$/', trim( $value ) )
11301113 ) {
11311114 return wfMsgExt( 'htmlform-int-invalid', 'parse' );
11321115 }
@@ -1346,11 +1329,13 @@
13471330 $html .= Html::rawElement( 'h1', array(), $label ) . "\n";
13481331 $html .= $this->formatOptions( $info, $value );
13491332 } else {
1350 - $thisAttribs = array( 'id' => $this->mID . "-$info", 'value' => $info );
 1333+ $thisAttribs = array( 'id' => "{$this->mID}-$info", 'value' => $info );
13511334
1352 - $checkbox = Xml::check( $this->mName . '[]', in_array( $info, $value, true ),
1353 - $attribs + $thisAttribs );
1354 - $checkbox .= '&#160;' . Html::rawElement( 'label', array( 'for' => $this->mID . "-$info" ), $label );
 1335+ $checkbox = Xml::check(
 1336+ $this->mName . '[]',
 1337+ in_array( $info, $value, true ),
 1338+ $attribs + $thisAttribs );
 1339+ $checkbox .= '&#160;' . Html::rawElement( 'label', array( 'for' => "{$this->mID}-$info" ), $label );
13551340
13561341 $html .= $checkbox . '<br />';
13571342 }
@@ -1490,6 +1475,10 @@
14911476 # forcing the 'wp' prefix on hidden field names
14921477 # is undesirable
14931478 $this->mName = substr( $this->mName, 2 );
 1479+
 1480+ # Per HTML5 spec, hidden fields cannot be 'required'
 1481+ # http://dev.w3.org/html5/spec/states-of-the-type-attribute.html#hidden-state
 1482+ unset( $this->mParams['required'] );
14941483 }
14951484
14961485 public function getTableRow( $value ) {
@@ -1535,6 +1524,13 @@
15361525 protected function needsLabel() {
15371526 return false;
15381527 }
 1528+
 1529+ /**
 1530+ * Button cannot be invalid
 1531+ */
 1532+ public function validate( $value, $alldata ){
 1533+ return true;
 1534+ }
15391535 }
15401536
15411537 class HTMLEditTools extends HTMLFormField {
Index: branches/REL1_17/phase3/includes/installer/WebInstaller.php
@@ -47,6 +47,7 @@
4848 */
4949 public $pageSequence = array(
5050 'Language',
 51+ 'ExistingWiki',
5152 'Welcome',
5253 'DBConnect',
5354 'Upgrade',
@@ -175,15 +176,7 @@
176177 # Get the page name.
177178 $pageName = $this->request->getVal( 'page' );
178179
179 - # Check LocalSettings status
180 - $localSettings = $this->getLocalSettingsStatus();
181 -
182 - if( !$localSettings->isGood() && $this->getVar( '_LocalSettingsLocked' ) ) {
183 - $pageName = 'Locked';
184 - $pageId = false;
185 - $page = $this->getPageByName( $pageName );
186 - $page->setLocalSettingsStatus( $localSettings );
187 - } elseif ( in_array( $pageName, $this->otherPages ) ) {
 180+ if ( in_array( $pageName, $this->otherPages ) ) {
188181 # Out of sequence
189182 $pageId = false;
190183 $page = $this->getPageByName( $pageName );
@@ -620,7 +613,7 @@
621614 ) . "\n" .
622615 "</div>\n" .
623616 "<div class=\"config-info-right\">\n" .
624 - $this->parse( $text ) . "\n" .
 617+ $this->parse( $text, true ) . "\n" .
625618 "</div>\n" .
626619 "<div style=\"clear: left;\"></div>\n" .
627620 "</div>\n";
Index: branches/REL1_17/phase3/includes/installer/Installer.php
@@ -215,33 +215,30 @@
216216 }
217217
218218 /**
219 - * Determine if LocalSettings exists. If it does, return an appropriate
220 - * status for whether upgrading is enabled or not.
 219+ * Determine if LocalSettings.php exists. If it does, return its variables,
 220+ * merged with those from AdminSettings.php, as an array.
221221 *
222 - * @return Status
 222+ * @return Array
223223 */
224 - public function getLocalSettingsStatus() {
 224+ public function getExistingLocalSettings() {
225225 global $IP;
226226
227 - $status = Status::newGood();
228 -
229227 wfSuppressWarnings();
230 - $ls = file_exists( "$IP/LocalSettings.php" );
 228+ $_lsExists = file_exists( "$IP/LocalSettings.php" );
231229 wfRestoreWarnings();
232230
233 - if( $ls ) {
 231+ if( $_lsExists ) {
234232 require( "$IP/includes/DefaultSettings.php" );
235 - require_once( "$IP/LocalSettings.php" );
 233+ require( "$IP/LocalSettings.php" );
 234+ if ( file_exists( "$IP/AdminSettings.php" ) ) {
 235+ require( "$IP/AdminSettings.php" );
 236+ }
236237 $vars = get_defined_vars();
237 - if( isset( $vars['wgUpgradeKey'] ) && $vars['wgUpgradeKey'] ) {
238 - $status->warning( 'config-localsettings-upgrade' );
239 - $this->setVar( '_UpgradeKey', $vars['wgUpgradeKey' ] );
240 - } else {
241 - $status->fatal( 'config-localsettings-noupgrade' );
242 - }
 238+ unset( $vars['_lsExists'] );
 239+ return $vars;
 240+ } else {
 241+ return false;
243242 }
244 -
245 - return $status;
246243 }
247244
248245 /**
@@ -329,6 +326,19 @@
330327 return $html;
331328 }
332329
 330+ public function getParserOptions() {
 331+ return $this->parserOptions;
 332+ }
 333+
 334+ public function disableLinkPopups() {
 335+ $this->parserOptions->setExternalLinkTarget( false );
 336+ }
 337+
 338+ public function restoreLinkPopups() {
 339+ global $wgExternalLinkTarget;
 340+ $this->parserOptions->setExternalLinkTarget( $wgExternalLinkTarget );
 341+ }
 342+
333343 /**
334344 * TODO: document
335345 *
Index: branches/REL1_17/phase3/includes/installer/CoreInstaller.php
@@ -84,8 +84,8 @@
8585 '_CCDone' => false,
8686 '_Extensions' => array(),
8787 '_MemCachedServers' => '',
88 - '_LocalSettingsLocked' => true,
89 - '_UpgradeKey' => '',
 88+ '_UpgradeKeySupplied' => false,
 89+ '_ExistingDBSettings' => false,
9090 );
9191
9292 /**
@@ -381,7 +381,7 @@
382382 *
383383 * @return Status
384384 */
385 - protected function generateSecret( $secretName ) {
 385+ protected function generateSecret( $secretName, $length = 64 ) {
386386 if ( wfIsWindows() ) {
387387 $file = null;
388388 } else {
@@ -393,12 +393,12 @@
394394 $status = Status::newGood();
395395
396396 if ( $file ) {
397 - $secretKey = bin2hex( fread( $file, 32 ) );
 397+ $secretKey = bin2hex( fread( $file, $length / 2 ) );
398398 fclose( $file );
399399 } else {
400400 $secretKey = '';
401401
402 - for ( $i=0; $i<8; $i++ ) {
 402+ for ( $i = 0; $i < $length / 8; $i++ ) {
403403 $secretKey .= dechex( mt_rand( 0, 0x7fffffff ) );
404404 }
405405
@@ -411,13 +411,15 @@
412412 }
413413
414414 /**
415 - * Generate a default $wgUpradeKey, Will warn if we had to use
 415+ * Generate a default $wgUpgradeKey. Will warn if we had to use
416416 * mt_rand() instead of /dev/urandom
417417 *
418418 * @return Status
419419 */
420 - protected function generateUpgradeKey() {
421 - return $this->generateSecret( 'wgUpgradeKey' );
 420+ public function generateUpgradeKey() {
 421+ if ( strval( $this->getVar( 'wgUpgradeKey' ) ) === '' ) {
 422+ return $this->generateSecret( 'wgUpgradeKey', 16 );
 423+ }
422424 }
423425
424426 /**
Index: branches/REL1_17/phase3/includes/installer/Installer.i18n.php
@@ -15,14 +15,22 @@
1616 'config-desc' => 'The installer for MediaWiki',
1717 'config-title' => 'MediaWiki $1 installation',
1818 'config-information' => 'Information',
19 - 'config-localsettings-upgrade' => "'''Warning''': A <code>LocalSettings.php</code> file has been detected.
20 -Your software is able to upgrade.
21 -Please fill in the value of <code>\$wgUpgradeKey</code> in the box.",
 19+ 'config-localsettings-upgrade' => "A <code>LocalSettings.php</code> file has been detected.
 20+To upgrade this installation, please enter the value of <code>\$wgUpgradeKey</code> in the box below.
 21+You will find it in LocalSettings.php.",
2222 'config-localsettings-key' => 'Upgrade key:',
23 - 'config-localsettings-badkey' => 'The key you provided is incorrect',
24 - 'config-localsettings-noupgrade' => "'''Error''': A <code>LocalSettings.php</code> file has been detected.
25 -Your software is not able to upgrade at this time.
26 -The installer has been disabled for security reasons.",
 23+ 'config-localsettings-badkey' => 'The key you provided is incorrect.',
 24+ 'config-upgrade-key-missing' => 'An existing installation of MediaWiki has been detected.
 25+To upgrade this installation, please put the following line at the bottom of your LocalSettings.php:
 26+
 27+$1
 28+',
 29+ 'config-localsettings-incomplete' => 'The existing LocalSettings.php appears to be incomplete.
 30+The $1 variable is not set.
 31+Please change LocalSettings.php so that this variable is set, and click "Continue".',
 32+ 'config-localsettings-connection-error' => 'An error was encountered when connecting to the database using the settings specified in LocalSettings.php or AdminSettings.php. Please fix these settings and try again.
 33+
 34+$1',
2735 'config-session-error' => 'Error starting session: $1',
2836 'config-session-expired' => 'Your session data seems to have expired.
2937 Sessions are configured for a lifetime of $1.
@@ -51,7 +59,7 @@
5260 'config-page-releasenotes' => 'Release notes',
5361 'config-page-copying' => 'Copying',
5462 'config-page-upgradedoc' => 'Upgrading',
55 - 'config-page-locked' => 'Permission denied',
 63+ 'config-page-existingwiki' => 'Existing wiki',
5664 'config-help-restart' => 'Do you want to clear all saved data that you have entered and restart the installation process?',
5765 'config-restart' => 'Yes, restart it',
5866 'config-welcome' => "=== Environmental checks ===
@@ -277,6 +285,9 @@
278286
279287 If you want to regenerate your <code>LocalSettings.php</code> file, click the button below.
280288 This is '''not recommended''' unless you are having problems with your wiki.",
 289+ 'config-upgrade-done-no-regenerate' => "Upgrade complete.
 290+
 291+You can now [$1 start using your wiki].",
281292 'config-regenerate' => 'Regenerate LocalSettings.php →',
282293 'config-show-table-status' => 'SHOW TABLE STATUS query failed!',
283294 'config-unknown-collation' => "'''Warning:''' Database is using unrecognised collation.",
Index: branches/REL1_17/phase3/includes/installer/LocalSettingsGenerator.php
@@ -282,7 +282,7 @@
283283
284284 # Site upgrade key. Must be set to a string (default provided) to turn on the
285285 # web installer while LocalSettings.php is in place
286 -#\$wgUpgradeKey = \"{$this->values['wgUpgradeKey']}\";
 286+\$wgUpgradeKey = \"{$this->values['wgUpgradeKey']}\";
287287
288288 ## Default skin: you can change the default skin. Use the internal symbolic
289289 ## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook', 'vector':
Index: branches/REL1_17/phase3/includes/installer/WebInstallerPage.php
@@ -49,7 +49,7 @@
5050 );
5151 }
5252
53 - public function endForm( $continue = 'continue' ) {
 53+ public function endForm( $continue = 'continue', $back = 'back' ) {
5454 $s = "<div class=\"config-submit\">\n";
5555 $id = $this->getId();
5656
@@ -63,10 +63,10 @@
6464 array( 'name' => "enter-$continue", 'style' => 'visibility:hidden;overflow:hidden;width:1px;margin:0' ) ) . "\n";
6565 }
6666
67 - if ( $id !== 0 ) {
68 - $s .= Xml::submitButton( wfMsg( 'config-back' ),
 67+ if ( $back ) {
 68+ $s .= Xml::submitButton( wfMsg( "config-$back" ),
6969 array(
70 - 'name' => 'submit-back',
 70+ 'name' => "submit-$back",
7171 'tabindex' => $this->parent->nextTabIndex()
7272 ) ) . "\n";
7373 }
@@ -116,56 +116,6 @@
117117 }
118118 }
119119
120 -class WebInstaller_Locked extends WebInstallerPage {
121 - // The status of Installer::getLocalSettingsStatus()
122 - private $status;
123 -
124 - public function setLocalSettingsStatus( Status $s ) {
125 - $this->status = $s;
126 - }
127 -
128 - protected function getId() {
129 - return 0;
130 - }
131 -
132 - public function execute() {
133 - $r = $this->parent->request;
134 - if( !$r->wasPosted() || !$this->status->isOK() ) {
135 - $this->display();
136 - return 'output';
137 - } else {
138 - $key = $r->getText( 'config_wpUpgradeKey' );
139 - if( !$key || $key !== $this->getVar( '_UpgradeKey' ) ) {
140 - $this->parent->showError( 'config-localsettings-badkey' );
141 - $this->display();
142 - return 'output';
143 - } else {
144 - $this->setVar( '_LocalSettingsLocked', false );
145 - return 'continue';
146 - }
147 - }
148 - }
149 -
150 - /**
151 - * Display stuff to the end user
152 - */
153 - private function display() {
154 - $this->startForm();
155 - $this->parent->showStatusBox( $this->status );
156 - $continue = false;
157 - if( $this->status->isOK() && !$this->status->isGood() ) {
158 - $this->addHTML( "<br />" .
159 - $this->parent->getTextBox( array(
160 - 'var' => 'wpUpgradeKey',
161 - 'label' => 'config-localsettings-key',
162 - ) )
163 - );
164 - $continue = 'continue';
165 - }
166 - $this->endForm( $continue );
167 - }
168 -}
169 -
170120 class WebInstaller_Language extends WebInstallerPage {
171121
172122 public function execute() {
@@ -222,7 +172,7 @@
223173 $this->getLanguageSelector( 'UserLang', 'config-your-language', $userLang, $this->parent->getHelpBox( 'config-your-language-help' ) ) .
224174 $this->getLanguageSelector( 'ContLang', 'config-wiki-language', $contLang, $this->parent->getHelpBox( 'config-wiki-language-help' ) );
225175 $this->addHTML( $s );
226 - $this->endForm();
 176+ $this->endForm( 'continue', false );
227177 }
228178
229179 /**
@@ -245,6 +195,146 @@
246196
247197 }
248198
 199+class WebInstaller_ExistingWiki extends WebInstallerPage {
 200+ public function execute() {
 201+ // If there is no LocalSettings.php, continue to the installer welcome page
 202+ $vars = $this->parent->getExistingLocalSettings();
 203+ if ( !$vars ) {
 204+ return 'skip';
 205+ }
 206+
 207+ // Check if the upgrade key supplied to the user has appeared in LocalSettings.php
 208+ if ( $vars['wgUpgradeKey'] !== false
 209+ && $this->getVar( '_UpgradeKeySupplied' )
 210+ && $this->getVar( 'wgUpgradeKey' ) === $vars['wgUpgradeKey'] )
 211+ {
 212+ // It's there, so the user is authorized
 213+ $status = $this->handleExistingUpgrade( $vars );
 214+ if ( $status->isOK() ) {
 215+ return 'skip';
 216+ } else {
 217+ $this->startForm();
 218+ $this->parent->showStatusBox( $status );
 219+ $this->endForm( 'continue' );
 220+ return 'output';
 221+ }
 222+ return $this->handleExistingUpgrade( $vars );
 223+ }
 224+
 225+ // If there is no $wgUpgradeKey, tell the user to add one to LocalSettings.php
 226+ if ( $vars['wgUpgradeKey'] === false ) {
 227+ if ( $this->getVar( 'wgUpgradeKey', false ) === false ) {
 228+ $this->parent->generateUpgradeKey();
 229+ $this->setVar( '_UpgradeKeySupplied', true );
 230+ }
 231+ $this->startForm();
 232+ $this->addHTML( $this->parent->getInfoBox(
 233+ wfMsgNoTrans( 'config-upgrade-key-missing',
 234+ "<pre>\$wgUpgradeKey = '" . $this->getVar( 'wgUpgradeKey' ) . "';</pre>" )
 235+ ) );
 236+ $this->endForm( 'continue' );
 237+ return 'output';
 238+ }
 239+
 240+ // If there is an upgrade key, but it wasn't supplied, prompt the user to enter it
 241+
 242+ $r = $this->parent->request;
 243+ if ( $r->wasPosted() ) {
 244+ $key = $r->getText( 'config_wgUpgradeKey' );
 245+ if( !$key || $key !== $vars['wgUpgradeKey'] ) {
 246+ $this->parent->showError( 'config-localsettings-badkey' );
 247+ $this->showKeyForm();
 248+ return 'output';
 249+ }
 250+ // Key was OK
 251+ $status = $this->handleExistingUpgrade( $vars );
 252+ if ( $status->isOK() ) {
 253+ return 'continue';
 254+ } else {
 255+ $this->parent->showStatusBox( $status );
 256+ $this->showKeyForm();
 257+ return 'output';
 258+ }
 259+ } else {
 260+ $this->showKeyForm();
 261+ return 'output';
 262+ }
 263+ }
 264+
 265+ /**
 266+ * Show the "enter key" form
 267+ */
 268+ protected function showKeyForm() {
 269+ $this->startForm();
 270+ $this->addHTML(
 271+ $this->parent->getInfoBox( wfMsgNoTrans( 'config-localsettings-upgrade' ) ).
 272+ '<br />' .
 273+ $this->parent->getTextBox( array(
 274+ 'var' => 'wgUpgradeKey',
 275+ 'label' => 'config-localsettings-key',
 276+ 'attribs' => array( 'autocomplete' => 'off' ),
 277+ ) )
 278+ );
 279+ $this->endForm( 'continue' );
 280+ }
 281+
 282+ protected function importVariables( $names, $vars ) {
 283+ $status = Status::newGood();
 284+ foreach ( $names as $name ) {
 285+ if ( !isset( $vars[$name] ) ) {
 286+ $status->fatal( 'config-localsettings-incomplete', $name );
 287+ }
 288+ $this->setVar( $name, $vars[$name] );
 289+ }
 290+ return $status;
 291+ }
 292+
 293+ /**
 294+ * Initiate an upgrade of the existing database
 295+ * @param $vars Variables from LocalSettings.php and AdminSettings.php
 296+ * @return Status
 297+ */
 298+ protected function handleExistingUpgrade( $vars ) {
 299+ // Check $wgDBtype
 300+ if ( !isset( $vars['wgDBtype'] ) || !in_array( $vars['wgDBtype'], Installer::getDBTypes() ) ) {
 301+ return Status::newFatal( 'config-localsettings-connection-error', '' );
 302+ }
 303+
 304+ // Set the relevant variables from LocalSettings.php
 305+ $requiredVars = array( 'wgDBtype', 'wgDBuser', 'wgDBpassword' );
 306+ $status = $this->importVariables( $requiredVars , $vars );
 307+ $installer = $this->parent->getDBInstaller();
 308+ $status->merge( $this->importVariables( $installer->getGlobalNames(), $vars ) );
 309+ if ( !$status->isOK() ) {
 310+ return $status;
 311+ }
 312+
 313+ if ( isset( $vars['wgDBadminuser'] ) ) {
 314+ $this->setVar( '_InstallUser', $vars['wgDBadminuser'] );
 315+ } else {
 316+ $this->setVar( '_InstallUser', $vars['wgDBuser'] );
 317+ }
 318+ if ( isset( $vars['wgDBadminpassword'] ) ) {
 319+ $this->setVar( '_InstallPassword', $vars['wgDBadminpassword'] );
 320+ } else {
 321+ $this->setVar( '_InstallPassword', $vars['wgDBpassword'] );
 322+ }
 323+
 324+ // Test the database connection
 325+ $status = $installer->getConnection();
 326+ if ( !$status->isOK() ) {
 327+ // Adjust the error message to explain things correctly
 328+ $status->replaceMessage( 'config-connection-error',
 329+ 'config-localsettings-connection-error' );
 330+ return $status;
 331+ }
 332+
 333+ // All good
 334+ $this->setVar( '_ExistingDBSettings', true );
 335+ return $status;
 336+ }
 337+}
 338+
249339 class WebInstaller_Welcome extends WebInstallerPage {
250340
251341 public function execute() {
@@ -268,6 +358,10 @@
269359 class WebInstaller_DBConnect extends WebInstallerPage {
270360
271361 public function execute() {
 362+ if ( $this->getVar( '_ExistingDBSettings' ) ) {
 363+ return 'skip';
 364+ }
 365+
272366 $r = $this->parent->request;
273367 if ( $r->wasPosted() ) {
274368 $status = $this->submit();
@@ -341,7 +435,10 @@
342436
343437 public function execute() {
344438 if ( $this->getVar( '_UpgradeDone' ) ) {
345 - if ( $this->parent->request->wasPosted() ) {
 439+ // Allow regeneration of LocalSettings.php, unless we are working
 440+ // from a pre-existing LocalSettings.php file and we want to avoid
 441+ // leaking its contents
 442+ if ( $this->parent->request->wasPosted() && !$this->getVar( '_ExistingDBSettings' ) ) {
346443 // Done message acknowledged
347444 return 'continue';
348445 } else {
@@ -389,16 +486,24 @@
390487
391488 public function showDoneMessage() {
392489 $this->startForm();
 490+ $regenerate = !$this->getVar( '_ExistingDBSettings' );
 491+ if ( $regenerate ) {
 492+ $msg = 'config-upgrade-done';
 493+ } else {
 494+ $msg = 'config-upgrade-done-no-regenerate';
 495+ }
 496+ $this->parent->disableLinkPopups();
393497 $this->addHTML(
394498 $this->parent->getInfoBox(
395 - wfMsgNoTrans( 'config-upgrade-done',
 499+ wfMsgNoTrans( $msg,
396500 $GLOBALS['wgServer'] .
397501 $this->getVar( 'wgScriptPath' ) . '/index' .
398502 $this->getVar( 'wgScriptExtension' )
399503 ), 'tick-32.png'
400504 )
401505 );
402 - $this->endForm( 'regenerate' );
 506+ $this->parent->restoreLinkPopups();
 507+ $this->endForm( $regenerate ? 'regenerate' : false, false );
403508 }
404509
405510 }
@@ -935,6 +1040,7 @@
9361041 $this->parent->request->response()->header( "Refresh: 0;$lsUrl" );
9371042
9381043 $this->startForm();
 1044+ $this->parent->disableLinkPopups();
9391045 $this->addHTML(
9401046 $this->parent->getInfoBox(
9411047 wfMsgNoTrans( 'config-install-done',
@@ -946,7 +1052,8 @@
9471053 ), 'tick-32.png'
9481054 )
9491055 );
950 - $this->endForm( false );
 1056+ $this->parent->restoreLinkPopups();
 1057+ $this->endForm( false, false );
9511058 }
9521059 }
9531060
Index: branches/REL1_17/phase3/includes/api/ApiQueryRecentChanges.php
@@ -79,7 +79,13 @@
8080 return false;
8181 }
8282
83 - return $wgUser->editToken( $rc->getAttribute( 'rc_id' ) );
 83+ // The patrol token is always the same, let's exploit that
 84+ static $cachedPatrolToken = null;
 85+ if ( is_null( $cachedPatrolToken ) ) {
 86+ $cachedPatrolToken = $wgUser->editToken( 'patrol' );
 87+ }
 88+
 89+ return $cachedPatrolToken;
8490 }
8591
8692 /**
Index: branches/REL1_17/phase3/includes/api/ApiPatrol.php
@@ -59,6 +59,10 @@
6060 $this->getResult()->addValue( null, $this->getModuleName(), $result );
6161 }
6262
 63+ public function mustBePosted() {
 64+ return true;
 65+ }
 66+
6367 public function isWriteMode() {
6468 return true;
6569 }
@@ -95,8 +99,7 @@
96100 }
97101
98102 public function getTokenSalt() {
99 - $params = $this->extractRequestParams();
100 - return $params['rcid'];
 103+ return 'patrol';
101104 }
102105
103106 protected function getExamples() {
Index: branches/REL1_17/phase3/includes/api/ApiQueryInfo.php
@@ -87,6 +87,7 @@
8888 'unblock' => array( 'ApiQueryInfo', 'getUnblockToken' ),
8989 'email' => array( 'ApiQueryInfo', 'getEmailToken' ),
9090 'import' => array( 'ApiQueryInfo', 'getImportToken' ),
 91+ 'patrol' => array( 'ApiQueryRecentChanges', 'getPatrolToken' ),
9192 );
9293 wfRunHooks( 'APIQueryInfoTokens', array( &$this->tokenFunctions ) );
9394 return $this->tokenFunctions;
Index: branches/REL1_17/phase3/includes/WebRequest.php
@@ -65,6 +65,11 @@
6666 public function interpolateTitle() {
6767 global $wgUsePathInfo;
6868
 69+ // bug 16019: title interpolation on API queries is useless and possible harmful
 70+ if ( defined( 'MW_API' ) ) {
 71+ return;
 72+ }
 73+
6974 if ( $wgUsePathInfo ) {
7075 // PATH_INFO is mangled due to http://bugs.php.net/bug.php?id=31892
7176 // And also by Apache 2.x, double slashes are converted to single slashes.
Index: branches/REL1_17/phase3/includes/AutoLoader.php
@@ -57,7 +57,6 @@
5858 'DBABagOStuff' => 'includes/BagOStuff.php',
5959 'DependencyWrapper' => 'includes/CacheDependency.php',
6060 'DiffHistoryBlob' => 'includes/HistoryBlob.php',
61 - 'DistributionRepository' => 'includes/DistributionRepository.php',
6261 'DjVuImage' => 'includes/DjVuImage.php',
6362 'DoubleReplacer' => 'includes/StringUtils.php',
6463 'DublinCoreRdf' => 'includes/Metadata.php',
@@ -172,7 +171,6 @@
173172 'MWNamespace' => 'includes/Namespace.php',
174173 'OldChangesList' => 'includes/ChangesList.php',
175174 'OutputPage' => 'includes/OutputPage.php',
176 - 'PackageRepository' => 'includes/PackageRepository.php',
177175 'PageQueryPage' => 'includes/PageQueryPage.php',
178176 'PageHistory' => 'includes/HistoryPage.php',
179177 'PageHistoryPager' => 'includes/HistoryPage.php',
Property changes on: branches/REL1_17/phase3/includes/AutoLoader.php
___________________________________________________________________
Modified: svn:mergeinfo
180178 Merged /trunk/phase3/includes/AutoLoader.php:r77981-77982,77994,78097,78118-78119,78137,78141,78165,78192,78204,78209,78230,78246,78250-78251,78264,78276,78404,78424
Index: branches/REL1_17/phase3/includes/DefaultSettings.php
@@ -2288,15 +2288,14 @@
22892289 * of new blocks in monobook. vector and modern should work without any special css.
22902290 *
22912291 * $wgFooterIcons itself is a key/value array.
2292 - * The key os the name of a block that the icons will be wrapped in.
2293 - * The final id varries by skin; Monobook and Vector will turn poweredby into f-poweredbyico
2294 - * while Modern turns it into mw_poweredby.
2295 - * The value is a key/value array of icons. The key may or may not be used by the
2296 - * skin but it can be used to find the icon and unset it or change the icon if needed.
2297 - * This is useful for disabling icons that are set by extensions.
2298 - * The value should be either a string or an array.
2299 - * If it is a string it will be output directly, however some skins may choose to ignore it.
2300 - * An array is the preferred format for the icon, the following keys are used:
 2292+ * The key is the name of a block that the icons will be wrapped in. The final id varies
 2293+ * by skin; Monobook and Vector will turn poweredby into f-poweredbyico while Modern
 2294+ * turns it into mw_poweredby. The value is a key/value array of icons. The key may or
 2295+ * may not be used by the skin but it can be used to find the icon and unset it or
 2296+ * change the icon if needed. This is useful for disabling icons that are set by extensions.
 2297+ * The value should be either a string or an array. If it is a string it will be output
 2298+ * directly, however some skins may choose to ignore it. An array is the preferred format
 2299+ * for the icon, the following keys are used:
23012300 * src: An absolute url to the image to use for the icon, this is recommended
23022301 * but not required, however some skins will ignore icons without an image
23032302 * url: The url to use in the <a> arround the text or icon, if not set an <a> will not be outputted
@@ -4132,8 +4131,13 @@
41334132 $wgReadOnlyFile = false;
41344133
41354134 /**
4136 - * If this is set to some string, this opens up config/index.php for upgrades
4137 - * when needed. You will need to provide this key to use it
 4135+ * When you run the web-based upgrade utility, it will tell you what to set
 4136+ * this to in order to authorize the upgrade process. It will subsequently be
 4137+ * used as a password, to authorize further upgrades.
 4138+ *
 4139+ * For security, do not set this to a guessable string. Use the value supplied
 4140+ * by the install/upgrade process. To cause the upgrader to generate a new key,
 4141+ * delete the old key from LocalSettings.php.
41384142 */
41394143 $wgUpgradeKey = false;
41404144
@@ -5233,8 +5237,6 @@
52345238 $wgSeleniumTestConfigs = array();
52355239 $wgSeleniumConfigFile = null;
52365240
5237 -
5238 -
52395241 /**
52405242 * For really cool vim folding this needs to be at the end:
52415243 * vim: foldmarker=@{,@} foldmethod=marker
Index: branches/REL1_17/phase3/includes/specials/SpecialListgrouprights.php
@@ -60,12 +60,23 @@
6161 '</tr>'
6262 );
6363
64 - $allGroups = array_unique( array_merge( array_keys( $wgGroupPermissions ),
65 - array_keys( $wgRevokePermissions ) ) );
 64+ $allGroups = array_unique( array_merge(
 65+ array_keys( $wgGroupPermissions ),
 66+ array_keys( $wgRevokePermissions ),
 67+ array_keys( $wgAddGroups ),
 68+ array_keys( $wgRemoveGroups ),
 69+ array_keys( $wgGroupsAddToSelf ),
 70+ array_keys( $wgGroupsRemoveFromSelf )
 71+ ) );
 72+ asort( $allGroups );
 73+
6674 foreach ( $allGroups as $group ) {
67 - $permissions = isset( $wgGroupPermissions[$group] ) ?
68 - $wgGroupPermissions[$group] : array();
69 - $groupname = ( $group == '*' ) ? 'all' : $group; // Replace * with a more descriptive groupname
 75+ $permissions = isset( $wgGroupPermissions[$group] )
 76+ ? $wgGroupPermissions[$group]
 77+ : array();
 78+ $groupname = ( $group == '*' ) // Replace * with a more descriptive groupname
 79+ ? 'all'
 80+ : $group;
7081
7182 $msg = wfMsg( 'group-' . $groupname );
7283 if ( wfEmptyMsg( 'group-' . $groupname, $msg ) || $msg == '' ) {
Index: branches/REL1_17/phase3/includes/specials/SpecialEmailuser.php
@@ -279,7 +279,7 @@
280280
281281 $status = UserMailer::send( $to, $mailFrom, $subject, $text, $replyTo );
282282
283 - if( !$status->isGood() && false ) {
 283+ if( !$status->isGood() ) {
284284 return $status;
285285 } else {
286286 // if the user requested a copy of this mail, do this now,
Index: branches/REL1_17/phase3/includes/Block.php
@@ -815,7 +815,7 @@
816816 // IPv6
817817 if ( IP::isIPv6( $range ) && $parts[1] >= 64 && $parts[1] <= 128 ) {
818818 $bits = $parts[1];
819 - $ipint = IP::toUnsigned6( $parts[0] );
 819+ $ipint = IP::toUnsigned( $parts[0] );
820820 # Native 32 bit functions WON'T work here!!!
821821 # Convert to a padded binary number
822822 $network = wfBaseConvert( $ipint, 10, 2, 128 );
Index: branches/REL1_17/phase3/includes/Preferences.php
@@ -29,6 +29,11 @@
3030 static $defaultPreferences = null;
3131 static $saveFilters = array(
3232 'timecorrection' => array( 'Preferences', 'filterTimezoneInput' ),
 33+ 'cols' => array( 'Preferences', 'filterIntval' ),
 34+ 'rows' => array( 'Preferences', 'filterIntval' ),
 35+ 'rclimit' => array( 'Preferences', 'filterIntval' ),
 36+ 'wllimit' => array( 'Preferences', 'filterIntval' ),
 37+ 'searchlimit' => array( 'Preferences', 'filterIntval' ),
3338 );
3439
3540 static function getPreferences( $user ) {
@@ -1214,6 +1219,10 @@
12151220 }
12161221 return $opt;
12171222 }
 1223+
 1224+ static function filterIntval( $value, $alldata ){
 1225+ return intval( $value );
 1226+ }
12181227
12191228 static function filterTimezoneInput( $tz, $alldata ) {
12201229 $data = explode( '|', $tz, 3 );
Index: branches/REL1_17/phase3/includes/SpecialPage.php
@@ -702,7 +702,16 @@
703703 * @param $file String: file which is included by execute(). It is also constructed from $name by default
704704 * @param $includable Boolean: whether the page can be included in normal pages
705705 */
706 - function __construct( $name = '', $restriction = '', $listed = true, $function = false, $file = 'default', $includable = false ) {
 706+ public function __construct( $name = '', $restriction = '', $listed = true, $function = false, $file = 'default', $includable = false ) {
 707+ $this->init( $name, $restriction, $listed, $function, $file, $includable );
 708+ }
 709+
 710+ /**
 711+ * Do the real work for the constructor, mainly so __call() can intercept
 712+ * calls to SpecialPage()
 713+ * @see __construct() for param docs
 714+ */
 715+ private function init( $name, $restriction, $listed, $function, $file, $includable ) {
707716 $this->mName = $name;
708717 $this->mRestriction = $restriction;
709718 $this->mListed = $listed;
@@ -719,6 +728,29 @@
720729 }
721730 }
722731
 732+ /**
 733+ * Use PHP's magic __call handler to get calls to the old PHP4 constructor
 734+ * because PHP E_STRICT yells at you for having __construct() and SpecialPage()
 735+ *
 736+ * @param $name String Name of called method
 737+ * @param $a Array Arguments to the method
 738+ * @deprecated Call isn't deprecated, but SpecialPage::SpecialPage() is
 739+ */
 740+ public function __call( $fName, $a ) {
 741+ // Sometimes $fName is SpecialPage, sometimes it's specialpage. <3 PHP
 742+ if( strtolower( $fName ) == 'specialpage' ) {
 743+ // Debug messages now, warnings in 1.19 or 1.20?
 744+ wfDebug( "Deprecated SpecialPage::SpecialPage() called, use __construct();\n" );
 745+ $name = isset( $a[0] ) ? $a[0] : '';
 746+ $restriction = isset( $a[1] ) ? $a[1] : '';
 747+ $listed = isset( $a[2] ) ? $a[2] : true;
 748+ $function = isset( $a[3] ) ? $a[3] : false;
 749+ $file = isset( $a[4] ) ? $a[4] : 'default';
 750+ $includable = isset( $a[5] ) ? $a[5] : false;
 751+ $this->init( $name, $restriction, $listed, $function, $file, $includable );
 752+ }
 753+ }
 754+
723755 /**#@+
724756 * Accessor
725757 *
Property changes on: branches/REL1_17/phase3/includes/SpecialPage.php
___________________________________________________________________
Modified: svn:mergeinfo
726758 Merged /trunk/phase3/includes/SpecialPage.php:r77981-77982,77994,78097,78118-78119,78137,78141,78165,78192,78204,78209,78230,78246,78250-78251,78264,78276,78404,78424
Index: branches/REL1_17/phase3/api.php
@@ -34,6 +34,9 @@
3535 * in the URL.
3636 */
3737
 38+// So extensions (and other code) can check whether they're running in API mode
 39+define( 'MW_API', true );
 40+
3841 // Initialise common code
3942 require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
4043
@@ -99,9 +102,6 @@
100103 }
101104 }
102105
103 -// So extensions can check whether they're running in API mode
104 -define( 'MW_API', true );
105 -
106106 // Set a dummy $wgTitle, because $wgTitle == null breaks various things
107107 // In a perfect world this wouldn't be necessary
108108 $wgTitle = Title::makeTitle( NS_MAIN, 'API' );
Index: branches/REL1_17/phase3/languages/messages/MessagesQqq.php
@@ -838,6 +838,10 @@
839839 'clearyourcache' => 'Text at the top of .js/.css pages',
840840 'usercssyoucanpreview' => "Text displayed on every css page. The 'Show preview' part should be the same as {{msg-mw|showpreview}} (or you can use <nowiki>{{int:showpreview}}</nowiki>).",
841841 'userjsyoucanpreview' => 'Text displayed on every js page.',
 842+'usercsspreview' => 'Text displayed on preview of every user .css subpage',
 843+'userjspreview' => 'Text displayed on preview of every user .js subpage',
 844+'sitecsspreview' => 'Text displayed on preview of .css pages in MediaWiki namespace',
 845+'sitejspreview' => 'Text displayed on preview of .js pages in MediaWiki namespace',
842846 'updated' => '{{Identical|Updated}}',
843847 'previewnote' => 'Note displayed when clicking on Show preview',
844848 'editing' => "Shown as page title when editing a page. \$1 is the name of the page that is being edited. Example: \"''Editing Main Page''\".",
Index: branches/REL1_17/phase3/languages/messages/MessagesEn.php
@@ -1300,6 +1300,10 @@
13011301 '''It has not yet been saved!'''",
13021302 'userjspreview' => "'''Remember that you are only testing/previewing your user JavaScript.'''
13031303 '''It has not yet been saved!'''",
 1304+'sitecsspreview' => "'''Remember that you are only previewing this global CSS.'''
 1305+'''It has not yet been saved!'''",
 1306+'sitejspreview' => "'''Remember that you are only previewing this global JavaScript code.'''
 1307+'''It has not yet been saved!'''",
13041308 'userinvalidcssjstitle' => "'''Warning:''' There is no skin \"\$1\".
13051309 Custom .css and .js pages use a lowercase title, e.g. {{ns:user}}:Foo/vector.css as opposed to {{ns:user}}:Foo/Vector.css.",
13061310 'updated' => '(Updated)',
Index: branches/REL1_17/phase3/RELEASE-NOTES
@@ -233,6 +233,7 @@
234234 * Special wrapping setups can now define MW_CONFIG_FILE to load a config file
235235 other than LocalSettings.php. This is like MW_CONFIG_CALLBACK but works in
236236 some cases where MW_CONFIG_CALLBACK will not work.
 237+* (bug 16019) $wgArticlePath = "/$1" no longer breaks API edit/watch actions
237238
238239 === Bug fixes in 1.17 ===
239240 * (bug 17560) Half-broken deletion moved image files to deletion archive
@@ -469,6 +470,8 @@
470471 * rebuildFileCache.php no longer creates inappropriate cache files for redirects
471472 * (bug 18372) $wgFileExtensions will now override $wgFileBlacklist
472473 * (bug 25512) Subcategory list should not include category prefix for members.
 474+* (bug 10871) Javascript and CSS pages in MediaWiki namespace are no longer treated
 475+ as wikitext on preview.
473476
474477 === API changes in 1.17 ===
475478 * (bug 22738) Allow filtering by action type on query=logevent.

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r77878Remove some of the rubbish that has been accumulating in the default LocalSet...tstarling15:00, 6 December 2010
r77981Show the source on preview for CSS and Javascript pages....platonides14:53, 7 December 2010
r77982Follow up r77981platonides14:55, 7 December 2010
r77994follow-up r77981: Fix class: mw-js -> mw-css for the CSS section...raymond17:25, 7 December 2010
r78097Fixed r76560: one more caller of now-private toUnsigned6aaron22:18, 8 December 2010
r78118* Made the web upgrade process more friendly. Instead of saying "access denie...tstarling08:24, 9 December 2010
r78119Follow up to r77883jeroendedauw09:31, 9 December 2010
r78137Followup r78118: $wgUpgradeKey was already in DefaultSettings, use Tim's bett...demon20:36, 9 December 2010
r78141BREAKING CHANGE: Require POST for patrolling revisions and salt the patrol to...btongminh21:29, 9 December 2010
r78165* Hide the "back" buttons on the completion pages, they are potentially confu...tstarling03:02, 10 December 2010
r78192Fix for r71961 (moved SpecialPage constructor from named to __construct()). I...demon15:15, 10 December 2010
r78204Fix for r78192, forgot to revert a testdemon19:38, 10 December 2010
r78209(bug 16019) Make WebRequest::interpolateTitle() do nothing when run from api.phpvyznev22:39, 10 December 2010
r78230Follow up r77981,r77982. Rename the new globalcsspreview/globaljspreview to s...platonides22:44, 11 December 2010
r78246Follow-up to r64866: follow the HTML5 spec when validating floats and ints, a...happy-melon15:32, 12 December 2010
r78250Follow-up r78246: clean several integer preferences before saving. It's not ...happy-melon15:38, 12 December 2010
r78251Follow-up r64903: rm leftover debugging code.happy-melon15:40, 12 December 2010
r78264Followup r75763, fixup wrong change of deprecated method...reedy18:35, 12 December 2010
r78276Fix fatal error from r78264ialex20:45, 12 December 2010
r78404In the vein of r75313, get groups from the $wg(Add|Remove)Groups and $wgGroup...happy-melon22:45, 14 December 2010
r78424Follow-up r77796: a couple of typos in the comment, and break more consistent...happy-melon01:03, 15 December 2010

Status & tagging log