w/s fixups
authorMark A. Hershberger <mah@users.mediawiki.org>
Sat, 12 Feb 2011 04:06:22 +0000 (04:06 +0000)
committerMark A. Hershberger <mah@users.mediawiki.org>
Sat, 12 Feb 2011 04:06:22 +0000 (04:06 +0000)
20 files changed:
includes/Article.php
includes/ConfEditor.php
includes/DefaultSettings.php
includes/EditPage.php
includes/LinkCache.php
includes/QueryPage.php
includes/SpecialPage.php
includes/Title.php
includes/WatchlistEditor.php
includes/diff/DifferenceEngine.php
includes/installer/DatabaseInstaller.php
includes/installer/WebInstallerPage.php
includes/job/UploadFromUrlJob.php
includes/libs/JavaScriptDistiller.php
includes/parser/CoreLinkFunctions.php
includes/parser/LinkHolderArray.php
includes/parser/Preprocessor_DOM.php
includes/specials/SpecialRevisiondelete.php
languages/Language.php
tests/phpunit/includes/api/ApiQueryTest.php

index 48516e5..82bef47 100644 (file)
@@ -1765,7 +1765,7 @@ class Article {
         *
         * @param $dbw DatabaseBase: object
         * @param $revision Revision: For ID number, and text used to set
-                           length and redirect status fields
+                                               length and redirect status fields
         * @param $lastRevision Integer: if given, will not overwrite the page field
         *                      when different from the currently set value.
         *                      Giving 0 indicates the new page flag should be set
@@ -4403,7 +4403,7 @@ class Article {
                        $parserOptions = new ParserOptions( $user );
                        $parserOptions->setTidy( true );
                        $parserOptions->enableLimitReport();
-                       
+
                        if ( $canonical ) {
                                $parserOptions->setUserLang( $wgLanguageCode ); # Must be set explicitely
                                return $parserOptions;
index b08b77d..c9fd207 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-/** 
+/**
  * This is a state machine style parser with two internal stacks:
  *   * A next state stack, which determines the state the machine will progress to next
  *   * A path stack, which keeps track of the logical location in the file.
@@ -40,8 +40,8 @@ class ConfEditor {
        /** The previous ConfEditorToken object */
        var $prevToken;
 
-       /** 
-        * The state machine stack. This is an array of strings where the topmost 
+       /**
+        * The state machine stack. This is an array of strings where the topmost
         * element will be popped off and become the next parser state.
         */
        var $stateStack;
@@ -66,7 +66,7 @@ class ConfEditor {
        var $pathStack;
 
        /**
-        * The elements of the top of the pathStack for every path encountered, indexed 
+        * The elements of the top of the pathStack for every path encountered, indexed
         * by slash-separated path.
         */
        var $pathInfo;
@@ -77,7 +77,7 @@ class ConfEditor {
        var $serial;
 
        /**
-        * Editor state. This consists of the internal copy/insert operations which 
+        * Editor state. This consists of the internal copy/insert operations which
         * are applied to the source string to obtain the destination string.
         */
        var $edits;
@@ -103,7 +103,7 @@ class ConfEditor {
        }
 
        /**
-        * Edit the text. Returns the edited text. 
+        * Edit the text. Returns the edited text.
         * @param $ops Array of operations.
         *
         * Operations are given as an associative array, with members:
@@ -114,20 +114,20 @@ class ConfEditor {
         *
         * delete
         *    Deletes an array element or statement with the specified path.
-        *    e.g. 
+        *    e.g.
         *        array('type' => 'delete', 'path' => '$foo/bar/baz' )
         *    is equivalent to the runtime PHP code:
         *        unset( $foo['bar']['baz'] );
         *
         * set
-        *    Sets the value of an array element. If the element doesn't exist, it 
-        *    is appended to the array. If it does exist, the value is set, with 
+        *    Sets the value of an array element. If the element doesn't exist, it
+        *    is appended to the array. If it does exist, the value is set, with
         *    comments and indenting preserved.
         *
         * append
         *    Appends a new element to the end of the array. Adds a trailing comma.
         *    e.g.
-        *        array( 'type' => 'append', 'path', '$foo/bar', 
+        *        array( 'type' => 'append', 'path', '$foo/bar',
         *            'key' => 'baz', 'value' => "'x'" )
         *    is like the PHP code:
         *        $foo['bar']['baz'] = 'x';
@@ -187,7 +187,7 @@ class ConfEditor {
                                        list( $indent, ) = $this->getIndent( $start );
                                        $textToInsert = "$indent$value,";
                                } else {
-                                       list( $indent, $arrowIndent ) = 
+                                       list( $indent, $arrowIndent ) =
                                                $this->getIndent( $start, $key, $lastEltInfo['arrowByte'] );
                                        $textToInsert = "$indent$key$arrowIndent=> $value,";
                                }
@@ -210,7 +210,7 @@ class ConfEditor {
                                        list( $indent, ) = $this->getIndent( $start );
                                        $textToInsert = "$indent$value,";
                                } else {
-                                       list( $indent, $arrowIndent ) = 
+                                       list( $indent, $arrowIndent ) =
                                                $this->getIndent( $start, $key, $info['arrowByte'] );
                                        $textToInsert = "$indent$key$arrowIndent=> $value,";
                                }
@@ -239,13 +239,13 @@ class ConfEditor {
                try {
                        $this->parse();
                } catch ( ConfEditorParseError $e ) {
-                       throw new MWException( 
+                       throw new MWException(
                                "Sorry, ConfEditor broke the file during editing and it won't parse anymore: " .
                                $e->getMessage() );
                }
                return $out;
        }
-       
+
        /**
         * Get the variables defined in the text
         * @return array( varname => value )
@@ -266,7 +266,7 @@ class ConfEditor {
                                strlen( $trimmedPath ) - strlen( $name ) );
                        if( substr( $parentPath, -1 ) == '/' )
                                $parentPath = substr( $parentPath, 0, -1 );
-                       
+
                        $value = substr( $this->text, $data['valueStartByte'],
                                $data['valueEndByte'] - $data['valueStartByte']
                        );
@@ -275,7 +275,7 @@ class ConfEditor {
                }
                return $vars;
        }
-       
+
        /**
         * Set a value in an array, unless it's set already. For instance,
         * setVar( $arr, 'foo/bar', 'baz', 3 ); will set
@@ -298,7 +298,7 @@ class ConfEditor {
                if ( !isset( $target[$key] ) )
                        $target[$key] = $value;
        }
-       
+
        /**
         * Parse a scalar value in PHP
         * @return mixed Parsed value
@@ -364,8 +364,8 @@ class ConfEditor {
        }
 
        /**
-        * Finds the source byte region which you would want to delete, if $pathName 
-        * was to be deleted. Includes the leading spaces and tabs, the trailing line 
+        * Finds the source byte region which you would want to delete, if $pathName
+        * was to be deleted. Includes the leading spaces and tabs, the trailing line
         * break, and any comments in between.
         */
        function findDeletionRegion( $pathName ) {
@@ -419,9 +419,9 @@ class ConfEditor {
        }
 
        /**
-        * Find the byte region in the source corresponding to the value part. 
-        * This includes the quotes, but does not include the trailing comma 
-        * or semicolon. 
+        * Find the byte region in the source corresponding to the value part.
+        * This includes the quotes, but does not include the trailing comma
+        * or semicolon.
         *
         * The end position is the past-the-end (end + 1) value as per convention.
         */
@@ -519,7 +519,7 @@ class ConfEditor {
        }
 
        /**
-        * Run the parser on the text. Throws an exception if the string does not 
+        * Run the parser on the text. Throws an exception if the string does not
         * match our defined subset of PHP syntax.
         */
        public function parse() {
@@ -706,7 +706,7 @@ class ConfEditor {
        }
 
        /**
-        * Set the parse position. Do not call this except from firstToken() and 
+        * Set the parse position. Do not call this except from firstToken() and
         * nextToken(), there is more to update than just the position.
         */
        protected function setPos( $pos ) {
@@ -800,7 +800,7 @@ class ConfEditor {
                if ( $this->currentToken && $this->currentToken->type == $type ) {
                        return $this->nextToken();
                } else {
-                       $this->error( "expected " . $this->getTypeName( $type ) . 
+                       $this->error( "expected " . $this->getTypeName( $type ) .
                                ", got " . $this->getTypeName( $this->currentToken->type ) );
                }
        }
@@ -875,7 +875,7 @@ class ConfEditor {
        }
 
        /**
-        * Go to the next path on the same level. This ends the current path and 
+        * Go to the next path on the same level. This ends the current path and
         * starts a new one. If $path is \@next, the new path is set to the next
         * numeric array element.
         */
@@ -889,7 +889,7 @@ class ConfEditor {
                } else {
                        $this->pathStack[$i]['name'] = $path;
                }
-               $this->pathStack[$i] = 
+               $this->pathStack[$i] =
                        array(
                                'startByte' => $this->byteNum,
                                'startToken' => $this->pos,
@@ -955,8 +955,8 @@ class ConfEditor {
        }
 
        /**
-        * Looks ahead to see if the given type is the next token type, starting 
-        * from the current position plus the given offset. Skips any intervening 
+        * Looks ahead to see if the given type is the next token type, starting
+        * from the current position plus the given offset. Skips any intervening
         * whitespace.
         */
        function isAhead( $type, $offset = 0 ) {
@@ -992,8 +992,8 @@ class ConfEditor {
                $out = '';
                foreach ( $this->tokens as $token ) {
                        $obj = $this->newTokenObj( $token );
-                       $out .= sprintf( "%-28s %s\n", 
-                               $this->getTypeName( $obj->type ), 
+                       $out .= sprintf( "%-28s %s\n",
+                               $this->getTypeName( $obj->type ),
                                addcslashes( $obj->text, "\0..\37" ) );
                }
                echo "<pre>" . htmlspecialchars( $out ) . "</pre>";
@@ -1008,7 +1008,7 @@ class ConfEditorParseError extends MWException {
        function __construct( $editor, $msg ) {
                $this->lineNum = $editor->lineNum;
                $this->colNum = $editor->colNum;
-               parent::__construct( "Parse error on line {$editor->lineNum} " . 
+               parent::__construct( "Parse error on line {$editor->lineNum} " .
                        "col {$editor->colNum}: $msg" );
        }
 
@@ -1028,7 +1028,7 @@ class ConfEditorParseError extends MWException {
  */
 class ConfEditorToken {
        var $type, $text;
-       
+
        static $scalarTypes = array( T_LNUMBER, T_DNUMBER, T_STRING, T_CONSTANT_ENCAPSED_STRING );
        static $skipTypes = array( T_WHITESPACE, T_COMMENT, T_DOC_COMMENT );
 
index 8a84e7f..a05259c 100644 (file)
@@ -443,11 +443,11 @@ $wgAllowCopyUploads = false;
 $wgAllowAsyncCopyUploads = false;
 
 /**
- * Max size for uploads, in bytes. If not set to an array, applies to all 
+ * Max size for uploads, in bytes. If not set to an array, applies to all
  * uploads. If set to an array, per upload type maximums can be set, using the
  * file and url keys. If the * key is set this value will be used as maximum
  * for non-specified types.
- * 
+ *
  * For example:
  *     $wgUploadSize = array(
  *             '*' => 250 * 1024,
@@ -455,7 +455,7 @@ $wgAllowAsyncCopyUploads = false;
  *     );
  * Sets the maximum for all uploads to 250 kB except for upload-by-url, which
  * will have a maximum of 500 kB.
- * 
+ *
  */
 $wgMaxUploadSize = 1024*1024*100; # 100MB
 
@@ -559,7 +559,7 @@ $wgMimeTypeBlacklist = array(
        # MS Office OpenXML and other Open Package Conventions files are zip files
        # and thus blacklisted just as other zip files. If you remove these entries
        # from the blacklist in your local configuration, a malicious file upload
-       # will be able to compromise the wiki's user accounts, and the user 
+       # will be able to compromise the wiki's user accounts, and the user
        # accounts of any other website in the same cookie domain.
        'application/x-opc+zip',
        'application/msword',
@@ -1697,9 +1697,9 @@ $wgClockSkewFudge = 5;
  * to setting $wgCacheEpoch to the modification time of LocalSettings.php, as
  * was previously done in the default LocalSettings.php file.
  *
- * On high-traffic wikis, this should be set to false, to avoid the need to 
+ * On high-traffic wikis, this should be set to false, to avoid the need to
  * check the file modification time, and to avoid the performance impact of
- * unnecessary cache invalidations. 
+ * unnecessary cache invalidations.
  */
 $wgInvalidateCacheOnLocalSettingsChange = true;
 
@@ -2293,7 +2293,7 @@ $wgEnableTooltipsAndAccesskeys = true;
 $wgBreakFrames = false;
 
 /**
- * The X-Frame-Options header to send on pages sensitive to clickjacking 
+ * The X-Frame-Options header to send on pages sensitive to clickjacking
  * attacks, such as edit pages. This prevents those pages from being displayed
  * in a frame or iframe. The options are:
  *
@@ -2303,9 +2303,9 @@ $wgBreakFrames = false;
  *         to allow framing within a trusted domain. This is insecure if there
  *         is a page on the same domain which allows framing of arbitrary URLs.
  *
- *   - false: Allow all framing. This opens up the wiki to XSS attacks and thus 
- *         full compromise of local user accounts. Private wikis behind a 
- *         corporate firewall are especially vulnerable. This is not 
+ *   - false: Allow all framing. This opens up the wiki to XSS attacks and thus
+ *         full compromise of local user accounts. Private wikis behind a
+ *         corporate firewall are especially vulnerable. This is not
  *         recommended.
  *
  * For extra safety, set $wgBreakFrames = true, to prevent framing on all pages,
@@ -2334,17 +2334,17 @@ $wgExperimentalHtmlIds = true;
  * You can add new icons to the built in copyright or poweredby, or you can create
  * a new block. Though note that you may need to add some custom css to get good styling
  * of new blocks in monobook. vector and modern should work without any special css.
- * 
+ *
  * $wgFooterIcons itself is a key/value array.
- * The key is the name of a block that the icons will be wrapped in. The final id varies 
- * by skin; Monobook and Vector will turn poweredby into f-poweredbyico while Modern 
+ * The key is the name of a block that the icons will be wrapped in. The final id varies
+ * by skin; Monobook and Vector will turn poweredby into f-poweredbyico while Modern
  * turns it into mw_poweredby.
  * The value is either key/value array of icons or a string.
  * In the key/value array the key may or may not be used by the skin but it can
  * be used to find the icon and unset it or change the icon if needed.
  * This is useful for disabling icons that are set by extensions.
- * The value should be either a string or an array. If it is a string it will be output 
- * directly as html, however some skins may choose to ignore it. An array is the preferred format 
+ * The value should be either a string or an array. If it is a string it will be output
+ * directly as html, however some skins may choose to ignore it. An array is the preferred format
  * for the icon, the following keys are used:
  *   src: An absolute url to the image to use for the icon, this is recommended
  *        but not required, however some skins will ignore icons without an image
@@ -3373,7 +3373,7 @@ $wgGroupsRemoveFromSelf = array();
  * Set of available actions that can be restricted via action=protect
  * You probably shouldn't change this.
  * Translated through restriction-* messages.
- * Title::getRestrictionTypes() will remove restrictions that are not 
+ * Title::getRestrictionTypes() will remove restrictions that are not
  * applicable to a specific title (upload currently)
  */
 $wgRestrictionTypes = array( 'edit', 'move', 'upload' );
@@ -4185,12 +4185,12 @@ $wgReadOnly             = null;
 $wgReadOnlyFile         = false;
 
 /**
- * When you run the web-based upgrade utility, it will tell you what to set 
+ * When you run the web-based upgrade utility, it will tell you what to set
  * this to in order to authorize the upgrade process. It will subsequently be
  * used as a password, to authorize further upgrades.
  *
- * For security, do not set this to a guessable string. Use the value supplied 
- * by the install/upgrade process. To cause the upgrader to generate a new key, 
+ * For security, do not set this to a guessable string. Use the value supplied
+ * by the install/upgrade process. To cause the upgrader to generate a new key,
  * delete the old key from LocalSettings.php.
  */
 $wgUpgradeKey = false;
@@ -4636,24 +4636,24 @@ $wgCategoryMagicGallery = true;
 $wgCategoryPagingLimit = 200;
 
 /**
- * Specify how category names should be sorted, when listed on a category page. 
+ * Specify how category names should be sorted, when listed on a category page.
  * A sorting scheme is also known as a collation.
  *
  * Available values are:
  *
  *   - uppercase: Converts the category name to upper case, and sorts by that.
  *
- *   - uca-default: Provides access to the Unicode Collation Algorithm with 
+ *   - uca-default: Provides access to the Unicode Collation Algorithm with
  *     the default element table. This is a compromise collation which sorts
  *     all languages in a mediocre way. However, it is better than "uppercase".
  *
- * To use the uca-default collation, you must have PHP's intl extension 
- * installed. See http://php.net/manual/en/intl.setup.php . The details of the 
- * resulting collation will depend on the version of ICU installed on the 
+ * To use the uca-default collation, you must have PHP's intl extension
+ * installed. See http://php.net/manual/en/intl.setup.php . The details of the
+ * resulting collation will depend on the version of ICU installed on the
  * server.
  *
  * After you change this, you must run maintenance/updateCollation.php to fix
- * the sort keys in the database. 
+ * the sort keys in the database.
  */
 $wgCategoryCollation = 'uppercase';
 
index bab93b0..fb245c8 100644 (file)
@@ -1333,7 +1333,7 @@ HTML
                if ( $this->wasDeletedSinceLastEdit() && 'save' == $this->formtype ) {
                        $username = $this->lastDelete->user_name;
                        $comment = $this->lastDelete->log_comment;
-       
+
                        // It is better to not parse the comment at all than to have templates expanded in the middle
                        // TODO: can the checkLabel be moved outside of the div so that wrapWikiMsg could be used?
                        $wgOut->addHTML(
@@ -1878,20 +1878,20 @@ HTML
                $data = $dbr->selectRow(
                        array( 'logging', 'user' ),
                        array( 'log_type',
-                              'log_action',
-                              'log_timestamp',
-                              'log_user',
-                              'log_namespace',
-                              'log_title',
-                              'log_comment',
-                              'log_params',
-                              'log_deleted',
-                              'user_name' ),
+                                  'log_action',
+                                  'log_timestamp',
+                                  'log_user',
+                                  'log_namespace',
+                                  'log_title',
+                                  'log_comment',
+                                  'log_params',
+                                  'log_deleted',
+                                  'user_name' ),
                        array( 'log_namespace' => $this->mTitle->getNamespace(),
-                              'log_title' => $this->mTitle->getDBkey(),
-                              'log_type' => 'delete',
-                              'log_action' => 'delete',
-                              'user_id=log_user' ),
+                                  'log_title' => $this->mTitle->getDBkey(),
+                                  'log_type' => 'delete',
+                                  'log_action' => 'delete',
+                                  'user_id=log_user' ),
                        __METHOD__,
                        array( 'LIMIT' => 1, 'ORDER BY' => 'log_timestamp DESC' )
                );
@@ -2379,11 +2379,11 @@ HTML
                                array_map( array( 'Xml', 'encodeJsVar' ), $params ) );
                        $script .= "addButton($paramList);\n";
                }
-               
+
                $wgOut->addScript( Html::inlineScript(
                        "if ( window.mediaWiki ) { jQuery(function(){{$script}}); }"
                ) );
-               
+
                $toolbar .= "\n</div>";
 
                wfRunHooks( 'EditPageBeforeEditToolbar', array( &$toolbar ) );
@@ -2715,7 +2715,7 @@ HTML
                switch ( $value ) {
                        case self::AS_HOOK_ERROR_EXPECTED:
                        case self::AS_CONTENT_TOO_BIG:
-                       case self::AS_ARTICLE_WAS_DELETED:
+                       case self::AS_ARTICLE_WAS_DELETED:
                        case self::AS_CONFLICT_DETECTED:
                        case self::AS_SUMMARY_NEEDED:
                        case self::AS_TEXTBOX_EMPTY:
@@ -2765,22 +2765,22 @@ HTML
                                $this->userNotLoggedInPage();
                                return false;
 
-                       case self::AS_READ_ONLY_PAGE_LOGGED:
-                       case self::AS_READ_ONLY_PAGE:
-                               $wgOut->readOnlyPage();
-                               return false;
+                       case self::AS_READ_ONLY_PAGE_LOGGED:
+                       case self::AS_READ_ONLY_PAGE:
+                               $wgOut->readOnlyPage();
+                               return false;
 
-                       case self::AS_RATE_LIMITED:
-                               $wgOut->rateLimited();
-                               return false;
+                       case self::AS_RATE_LIMITED:
+                               $wgOut->rateLimited();
+                               return false;
 
-                       case self::AS_NO_CREATE_PERMISSION:
-                               $this->noCreatePermission();
-                               return;
+                       case self::AS_NO_CREATE_PERMISSION:
+                               $this->noCreatePermission();
+                               return;
 
                        case self::AS_BLANK_ARTICLE:
-                               $wgOut->redirect( $this->getContextTitle()->getFullURL() );
-                               return false;
+                               $wgOut->redirect( $this->getContextTitle()->getFullURL() );
+                               return false;
 
                        case self::AS_IMAGE_REDIRECT_LOGGED:
                                $wgOut->permissionRequired( 'upload' );
index 767b323..e2db69a 100644 (file)
@@ -150,7 +150,7 @@ class LinkCache {
                        wfProfileOut( __METHOD__ );
                        return 0;
                }
-               
+
                # Some fields heavily used for linking...
                if ( $this->mForUpdate ) {
                        $db = wfGetDB( DB_MASTER );
@@ -164,7 +164,7 @@ class LinkCache {
                        $options = array();
                }
 
-               $s = $db->selectRow( 'page', 
+               $s = $db->selectRow( 'page',
                        array( 'page_id', 'page_len', 'page_is_redirect', 'page_latest' ),
                        array( 'page_namespace' => $nt->getNamespace(), 'page_title' => $nt->getDBkey() ),
                        __METHOD__, $options );
index 9078e63..7edc7db 100644 (file)
@@ -130,7 +130,7 @@ abstract class QueryPage extends SpecialPage {
        function getQueryInfo() {
                return null;
        }
-       
+
        /**
         * For back-compat, subclasses may return a raw SQL query here, as a string.
         * This is stronly deprecated; getQueryInfo() should be overridden instead.
@@ -274,7 +274,7 @@ abstract class QueryPage extends SpecialPage {
                if ( !$this->isCacheable() ) {
                        return 0;
                }
-               
+
                $fname = get_class( $this ) . '::recache';
                $dbw = wfGetDB( DB_MASTER );
                $dbr = wfGetDB( DB_SLAVE, array( $this->getName(), __METHOD__, 'vslow' ) );
index d220990..cfd8803 100644 (file)
@@ -660,7 +660,7 @@ class SpecialPage {
                                }
                        }
                        if ( !$found ) {
-                               wfWarn( "Did not find alias for special page '$name'. " . 
+                               wfWarn( "Did not find alias for special page '$name'. " .
                                        "Perhaps no aliases are defined for it?" );
                        }
                }
index a0b36e8..54e2dce 100644 (file)
@@ -76,7 +76,7 @@ class Title {
        # Don't change the following default, NS_MAIN is hardcoded in several
        # places.  See bug 696.
        var $mDefaultNamespace = NS_MAIN; // /< Namespace index when there is no namespace
-                                         # Zero except in {{transclusion}} tags
+                                                                         # Zero except in {{transclusion}} tags
        var $mWatched = null;             // /< Is $wgUser watching this page? null if unfilled, accessed through userIsWatching()
        var $mLength = -1;                // /< The page length, 0 for special pages
        var $mRedirect = null;            // /< Is the article at this title a redirect?
@@ -226,7 +226,7 @@ class Title {
                        return array();
                }
                $dbr = wfGetDB( DB_SLAVE );
-               
+
                $res = $dbr->select(
                        'page',
                        array(
@@ -1427,7 +1427,7 @@ class Title {
 
        /**
         * Check restrictions on cascading pages.
-        * 
+        *
         * @param $action String the action to check
         * @param $user User to check
         * @param $errors Array list of current errors
@@ -1841,7 +1841,7 @@ class Title {
         * cache that we don't need to over-optimize by doing direct comparisons and
         * acidentally creating new bugs where $title->equals( Title::newFromText() )
         * ends up reporting something differently than $title->isMainPage();
-        * 
+        *
         * @return Bool
         */
        public function isMainPage() {
@@ -2004,7 +2004,7 @@ class Title {
        public function userCanEditJsSubpage() {
                global $wgUser;
                return ( ( $wgUser->isAllowed( 'editusercssjs' ) && $wgUser->isAllowed( 'edituserjs' ) )
-                      || preg_match( '/^' . preg_quote( $wgUser->getName(), '/' ) . '\//', $this->mTextform ) );
+                          || preg_match( '/^' . preg_quote( $wgUser->getName(), '/' ) . '\//', $this->mTextform ) );
        }
 
        /**
@@ -2503,6 +2503,7 @@ class Title {
                if ( $this->mInterwiki != '' ) {
                        $p = $this->mInterwiki . ':';
                }
+
                if ( 0 != $this->mNamespace ) {
                        $p .= $this->getNsText() . ':';
                }
@@ -2640,7 +2641,7 @@ class Title {
 
                                        # Redundant interwiki prefix to the local wiki
                                        if ( $wgLocalInterwiki !== false
-                                               && 0 == strcasecmp( $this->mInterwiki, $wgLocalInterwiki ) ) 
+                                               && 0 == strcasecmp( $this->mInterwiki, $wgLocalInterwiki ) )
                                        {
                                                if ( $dbkey == '' ) {
                                                        # Can't have an empty self-link
@@ -2687,13 +2688,13 @@ class Title {
                # reachable due to the way web browsers deal with 'relative' URLs.
                # Also, they conflict with subpage syntax.  Forbid them explicitly.
                if ( strpos( $dbkey, '.' ) !== false &&
-                    ( $dbkey === '.' || $dbkey === '..' ||
-                      strpos( $dbkey, './' ) === 0  ||
-                      strpos( $dbkey, '../' ) === 0 ||
-                      strpos( $dbkey, '/./' ) !== false ||
-                      strpos( $dbkey, '/../' ) !== false  ||
-                      substr( $dbkey, -2 ) == '/.' ||
-                      substr( $dbkey, -3 ) == '/..' ) )
+                        ( $dbkey === '.' || $dbkey === '..' ||
+                          strpos( $dbkey, './' ) === 0  ||
+                          strpos( $dbkey, '../' ) === 0 ||
+                          strpos( $dbkey, '/./' ) !== false ||
+                          strpos( $dbkey, '/../' ) !== false  ||
+                          substr( $dbkey, -2 ) == '/.' ||
+                          substr( $dbkey, -3 ) == '/..' ) )
                {
                        return false;
                }
@@ -2972,7 +2973,7 @@ class Title {
                }
                if ( ( $this->getDBkey() == '' ) ||
                         ( !$oldid ) ||
-                    ( $nt->getDBkey() == '' ) ) {
+                        ( $nt->getDBkey() == '' ) ) {
                        $errors[] = array( 'badarticleerror' );
                }
 
@@ -3092,7 +3093,7 @@ class Title {
                );
                $dbw->update( 'categorylinks',
                        array(
-                               'cl_sortkey' => Collation::singleton()->getSortKey( 
+                               'cl_sortkey' => Collation::singleton()->getSortKey(
                                        $nt->getCategorySortkey( $prefix ) ),
                                'cl_timestamp=cl_timestamp' ),
                        array( 'cl_from' => $pageid ),
@@ -3694,7 +3695,7 @@ class Title {
 
        /**
         * Callback for usort() to do title sorts by (namespace, title)
-        * 
+        *
         * @return Integer: result of string comparison, or namespace comparison
         */
        public static function compare( $a, $b ) {
@@ -3922,8 +3923,8 @@ class Title {
                // Spec: http://www.sixapart.com/pronet/docs/trackback_spec
                return "<!--
 <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"
-         xmlns:dc=\"http://purl.org/dc/elements/1.1/\"
-         xmlns:trackback=\"http://madskills.com/public/xml/rss/module/trackback/\">
+                xmlns:dc=\"http://purl.org/dc/elements/1.1/\"
+                xmlns:trackback=\"http://madskills.com/public/xml/rss/module/trackback/\">
 <rdf:Description
    rdf:about=\"$url\"
    dc:identifier=\"$url\"
@@ -4108,15 +4109,15 @@ class Title {
         */
        public function getRestrictionTypes() {
                global $wgRestrictionTypes;
-               
+
                $types = $this->exists() ? $wgRestrictionTypes : array( 'create' );
 
                if ( $this->getNamespace() != NS_FILE ) {
                        $types = array_diff( $types, array( 'upload' ) );
                }
-               
+
                wfRunHooks( 'TitleGetRestrictionTypes', array( $this, &$types ) );
-               
+
                return $types;
        }
 
index b5a994d..644a600 100644 (file)
@@ -220,7 +220,7 @@ class WatchlistEditor {
 
                if( $res && $dbr->numRows( $res ) > 0 ) {
                        $cache = LinkCache::singleton();
-                       foreach ( $res as $row ) {                      
+                       foreach ( $res as $row ) {
                                $title = Title::makeTitleSafe( $row->wl_namespace, $row->wl_title );
                                if( $title instanceof Title ) {
                                        // Update the link cache while we're at it
index 7ebc8fe..a2ca73f 100644 (file)
@@ -445,7 +445,7 @@ CONTROL;
 
                        $this->loadNewText();
                        $wgOut->setRevisionId( $this->mNewRev->getId() );
-       
+
                        if ( $this->mTitle->isCssJsSubpage() || $this->mTitle->isCssOrJsPage() ) {
                                // Stolen from Article::view --AG 2007-10-11
                                // Give hooks a chance to customise the output
@@ -465,7 +465,7 @@ CONTROL;
                                        $wgOut->addParserOutput( $pOutput );
                                } else {
                                        $article->doViewParse();
-                               } 
+                               }
                        } else {
                                $wgOut->addWikiTextTidy( $this->mNewtext );
                        }
index ae265c6..cb0f6df 100644 (file)
@@ -96,7 +96,7 @@ abstract class DatabaseInstaller {
 
        /**
         * Open a connection to the database using the administrative user/password
-        * currently defined in the session, without any caching. Returns a status 
+        * currently defined in the session, without any caching. Returns a status
         * object. On success, the status object will contain a Database object in
         * its value member.
         *
@@ -114,9 +114,9 @@ abstract class DatabaseInstaller {
 
        /**
         * Connect to the database using the administrative user/password currently
-        * defined in the session. Returns a status object. On success, the status 
+        * defined in the session. Returns a status object. On success, the status
         * object will contain a Database object in its value member.
-        * 
+        *
         * This will return a cached connection if one is available.
         *
         * @return Status
@@ -212,7 +212,7 @@ abstract class DatabaseInstaller {
        public abstract function getLocalSettings();
 
        /**
-        * Override this to provide DBMS-specific schema variables, to be 
+        * Override this to provide DBMS-specific schema variables, to be
         * substituted into tables.sql and other schema files.
         */
        public function getSchemaVars() {
@@ -236,7 +236,7 @@ abstract class DatabaseInstaller {
 
        /**
         * Set up LBFactory so that wfGetDB() etc. works.
-        * We set up a special LBFactory instance which returns the current 
+        * We set up a special LBFactory instance which returns the current
         * installer connection.
         */
        public function enableLB() {
index 902b620..60f6d58 100644 (file)
@@ -368,6 +368,7 @@ class WebInstaller_DBConnect extends WebInstallerPage {
                $r = $this->parent->request;
                if ( $r->wasPosted() ) {
                        $status = $this->submit();
+
                        if ( $status->isGood() ) {
                                $this->setVar( '_UpgradeDone', false );
                                return 'continue';
index 63166ef..d48104b 100644 (file)
@@ -8,7 +8,7 @@
 
 /**
  * Job for asynchronous upload-by-url.
- * 
+ *
  * This job is in fact an interface to UploadFromUrl, which is designed such
  * that it does not require any globals. If it does, fix it elsewhere, do not
  * add globals in here.
@@ -17,7 +17,7 @@
  */
 class UploadFromUrlJob extends Job {
        const SESSION_KEYNAME = 'wsUploadFromUrlJobData';
-       
+
        public $upload;
        protected $user;
 
@@ -28,20 +28,20 @@ class UploadFromUrlJob extends Job {
        public function run() {
                # Initialize this object and the upload object
                $this->upload = new UploadFromUrl();
-               $this->upload->initialize( 
-                       $this->title->getText(), 
+               $this->upload->initialize(
+                       $this->title->getText(),
                        $this->params['url'],
                        false
                );
                $this->user = User::newFromName( $this->params['userName'] );
-               
+
                # Fetch the file
                $status = $this->upload->fetchFile();
                if ( !$status->isOk() ) {
                        $this->leaveMessage( $status );
                        return true;
                }
-               
+
                # Verify upload
                $result = $this->upload->verifyUpload();
                if ( $result['status'] != UploadBase::OK ) {
@@ -49,17 +49,17 @@ class UploadFromUrlJob extends Job {
                        $this->leaveMessage( $status );
                        return true;
                }
-               
+
                # Check warnings
                if ( !$this->params['ignoreWarnings'] ) {
                        $warnings = $this->upload->checkWarnings();
-                       if ( $warnings ) {              
+                       if ( $warnings ) {
                                wfSetupSession( $this->params['sessionId'] );
-                                                               
+
                                if ( $this->params['leaveMessage'] ) {
-                                       $this->user->leaveUserMessage( 
+                                       $this->user->leaveUserMessage(
                                                wfMsg( 'upload-warning-subj' ),
-                                               wfMsg( 'upload-warning-msg', 
+                                               wfMsg( 'upload-warning-msg',
                                                        $this->params['sessionKey'],
                                                        $this->params['url'] )
                                        );
@@ -67,17 +67,17 @@ class UploadFromUrlJob extends Job {
                                        $this->storeResultInSession( 'Warning',
                                                'warnings', $warnings );
                                }
-                               
+
                                # Stash the upload in the session
                                $this->upload->stashSession( $this->params['sessionKey'] );
                                session_write_close();
-                               
+
                                return true;
                        }
                }
-               
+
                # Perform the upload
-               $status = $this->upload->performUpload( 
+               $status = $this->upload->performUpload(
                        $this->params['comment'],
                        $this->params['pageText'],
                        $this->params['watch'],
@@ -85,47 +85,47 @@ class UploadFromUrlJob extends Job {
                );
                $this->leaveMessage( $status );
                return true;
-               
+
        }
-       
+
        /**
         * Leave a message on the user talk page or in the session according to
         * $params['leaveMessage'].
-        * 
+        *
         * @param $status Status
         */
        protected function leaveMessage( $status ) {
                if ( $this->params['leaveMessage'] ) {
                        if ( $status->isGood() ) {
                                $this->user->leaveUserMessage( wfMsg( 'upload-success-subj' ),
-                                       wfMsg( 'upload-success-msg', 
+                                       wfMsg( 'upload-success-msg',
                                                $this->upload->getTitle()->getText(),
-                                               $this->params['url'] 
+                                               $this->params['url']
                                        ) );
                        } else {
                                $this->user->leaveUserMessage( wfMsg( 'upload-failure-subj' ),
-                                       wfMsg( 'upload-failure-msg', 
+                                       wfMsg( 'upload-failure-msg',
                                                $status->getWikiText(),
                                                $this->params['url']
                                        ) );
                        }
                } else {
-                       wfSetupSession( $this->params['sessionId'] );                   
+                       wfSetupSession( $this->params['sessionId'] );
                        if ( $status->isOk() ) {
-                               $this->storeResultInSession( 'Success', 
+                               $this->storeResultInSession( 'Success',
                                        'filename', $this->upload->getLocalFile()->getName() );
                        } else {
                                $this->storeResultInSession( 'Failure',
                                        'errors', $status->getErrorsArray() );
                        }
-                       session_write_close();                  
+                       session_write_close();
                }
        }
 
        /**
         * Store a result in the session data. Note that the caller is responsible
         * for appropriate session_start and session_write_close calls.
-        * 
+        *
         * @param $result String: the result (Success|Warning|Failure)
         * @param $dataKey String: the key of the extra data
         * @param $dataValue Mixed: the extra data itself
@@ -135,7 +135,7 @@ class UploadFromUrlJob extends Job {
                $session['result'] = $result;
                $session[$dataKey] = $dataValue;
        }
-       
+
        /**
         * Initialize the session data. Sets the intial result to queued.
         */
@@ -143,7 +143,7 @@ class UploadFromUrlJob extends Job {
                $session =& self::getSessionData( $this->params['sessionKey'] );
                $$session['result'] = 'Queued';
        }
-       
+
        public static function &getSessionData( $key ) {
                if ( !isset( $_SESSION[self::SESSION_KEYNAME][$key] ) ) {
                        $_SESSION[self::SESSION_KEYNAME][$key] = array();
index dd0c35d..91d330b 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
  * JavaScript Distiller
- * 
+ *
  * Author: Dean Edwards, Nicholas Martin, Trevor Parscal
  * License: LGPL
  */
@@ -11,10 +11,10 @@ class JavaScriptDistiller {
 
        /**
         * Removes most of the white-space from JavaScript code.
-        * 
+        *
         * This code came from the first pass of Dean Edwards' JavaScript Packer.  Compared to using
         * JSMin::minify, this produces < 1% larger output (after gzip) in approx. 25% of the time.
-        * 
+        *
         * @param $script String: JavaScript code to minify
         * @param $stripVerticalSpace Boolean: Try to remove as much vertical whitespace as possible
         */
@@ -60,7 +60,7 @@ class JavaScriptDistiller {
 
        /*
         * Creates an instance of ParseMaster and protects sensitive JavaScript regions.
-        * 
+        *
         * This parser is based on regular expressions, which all get or'd together, so rules take
         * precedence in the order they are added. We can use it to minify by armoring certain regions
         * by matching them and replacing them with the full match, leaving the remaining regions around
@@ -94,23 +94,23 @@ class JavaScriptDistiller {
  * ParseMaster, version 1.0.2 (2005-08-19) Copyright 2005, Dean Edwards
  * A multi-pattern parser.
  * License: http://creativecommons.org/licenses/LGPL/2.1/
- * 
+ *
  * This is the PHP version of the ParseMaster component of Dean Edwards' (http://dean.edwards.name/)
  * Packer, which was originally written in JavaScript. It was ported to PHP by Nicolas Martin.
- * 
+ *
  * Original Source: http://joliclic.free.fr/php/javascript-packer/en/
- * 
+ *
  * Changes should be pushed back upstream.
  */
 class ParseMaster {
        public $ignoreCase = false;
        public $escapeChar = '';
-       
+
        // constants
        const EXPRESSION = 0;
        const REPLACEMENT = 1;
        const LENGTH = 2;
-       
+
        // used to determine nesting levels
        private $GROUPS = '/\\(/';//g
        private $SUB_REPLACE = '/\\$\\d/';
@@ -119,12 +119,12 @@ class ParseMaster {
        private $ESCAPE = '/\\\./';//g
        private $QUOTE = '/\'/';
        private $DELETED = '/\\x01[^\\x01]*\\x01/';//g
-       
+
        public function add($expression, $replacement = '') {
                // count the number of sub-expressions
                //  - add one because each pattern is itself a sub-expression
                $length = 1 + preg_match_all($this->GROUPS, $this->_internalEscape((string)$expression), $out);
-               
+
                // treat only strings $replacement
                if (is_string($replacement)) {
                        // does the pattern deal with sub-expressions?
@@ -136,7 +136,7 @@ class ParseMaster {
                                } else { // a complicated lookup (e.g. "Hello $2 $1")
                                        // build a function to do the lookup
                                        $quote = preg_match($this->QUOTE, $this->_internalEscape($replacement))
-                                                ? '"' : "'";
+                                                        ? '"' : "'";
                                        $replacement = array(
                                                'fn' => '_backReferences',
                                                'data' => array(
@@ -152,11 +152,11 @@ class ParseMaster {
                if (!empty($expression)) $this->_add($expression, $replacement, $length);
                else $this->_add('/^$/', $replacement, $length);
        }
-       
+
        public function exec($string) {
                // execute the global replacement
                $this->_escaped = array();
-               
+
                // simulate the _patterns.toSTring of Dean
                $regexp = '/';
                foreach ($this->_patterns as $reg) {
@@ -164,7 +164,7 @@ class ParseMaster {
                }
                $regexp = substr($regexp, 0, -1) . '/S';
                $regexp .= ($this->ignoreCase) ? 'i' : '';
-               
+
                $string = $this->_escape($string, $this->escapeChar);
                $string = preg_replace_callback(
                        $regexp,
@@ -175,10 +175,10 @@ class ParseMaster {
                        $string
                );
                $string = $this->_unescape($string, $this->escapeChar);
-               
+
                return preg_replace($this->DELETED, '', $string);
        }
-               
+
        public function reset() {
                // clear the patterns collection so that this object may be re-used
                $this->_patterns = array();
@@ -187,17 +187,17 @@ class ParseMaster {
        // private
        private $_escaped = array();  // escaped characters
        private $_patterns = array(); // patterns stored by index
-       
+
        // create and add a new pattern to the patterns collection
        private function _add() {
                $arguments = func_get_args();
                $this->_patterns[] = $arguments;
        }
-       
+
        // this is the global replace function (it's quite complicated)
        private function _replacement($arguments) {
                if (empty($arguments)) return '';
-               
+
                $i = 1; $j = 0;
                // loop through the patterns
                while (isset($this->_patterns[$j])) {
@@ -205,28 +205,28 @@ class ParseMaster {
                        // do we have a result?
                        if (isset($arguments[$i]) && ($arguments[$i] != '')) {
                                $replacement = $pattern[self::REPLACEMENT];
-                               
+
                                if (is_array($replacement) && isset($replacement['fn'])) {
-                                       
+
                                        if (isset($replacement['data'])) $this->buffer = $replacement['data'];
                                        return call_user_func(array(&$this, $replacement['fn']), $arguments, $i);
-                                       
+
                                } elseif (is_int($replacement)) {
                                        return $arguments[$replacement + $i];
-                               
+
                                }
                                $delete = ($this->escapeChar == '' ||
-                                          strpos($arguments[$i], $this->escapeChar) === false)
-                                       ? '' : "\x01" . $arguments[$i] . "\x01";
+                                                  strpos($arguments[$i], $this->escapeChar) === false)
+                                               ? '' : "\x01" . $arguments[$i] . "\x01";
                                return $delete . $replacement;
-                       
+
                        // skip over references to sub-expressions
                        } else {
                                $i += $pattern[self::LENGTH];
                        }
                }
        }
-       
+
        private function _backReferences($match, $offset) {
                $replacement = $this->buffer['replacement'];
                $quote = $this->buffer['quote'];
@@ -236,22 +236,22 @@ class ParseMaster {
                }
                return $replacement;
        }
-       
+
        private function _replace_name($match, $offset){
                $length = strlen($match[$offset + 2]);
                $start = $length - max($length - strlen($match[$offset + 3]), 0);
                return substr($match[$offset + 1], $start, $length) . $match[$offset + 4];
        }
-       
+
        private function _replace_encoded($match, $offset) {
                return $this->buffer[$match[$offset]];
        }
-       
-       
+
+
        // php : we cannot pass additional data to preg_replace_callback,
        // and we cannot use &$this in create_function, so let's go to lower level
        private $buffer;
-       
+
        // encode escaped characters
        private function _escape($string, $escapeChar) {
                if ($escapeChar) {
@@ -261,7 +261,7 @@ class ParseMaster {
                                array(&$this, '_escapeBis'),
                                $string
                        );
-                       
+
                } else {
                        return $string;
                }
@@ -270,7 +270,7 @@ class ParseMaster {
                $this->_escaped[] = $match[1];
                return $this->buffer;
        }
-       
+
        // decode escaped characters
        private function _unescape($string, $escapeChar) {
                if ($escapeChar) {
@@ -282,7 +282,7 @@ class ParseMaster {
                                array(&$this, '_unescapeBis'),
                                $string
                        );
-                       
+
                } else {
                        return $string;
                }
@@ -298,7 +298,7 @@ class ParseMaster {
                $this->buffer['i']++;
                return $this->buffer['escapeChar'] . $temp;
        }
-       
+
        private function _internalEscape($string) {
                return preg_replace($this->ESCAPE, '', $string);
        }
index 913ec22..772ab0d 100644 (file)
@@ -27,7 +27,7 @@ class CoreLinkFunctions {
                }
                return $holders->makeHolder( $title, isset($displayText) ? $displayText : $titleText, '', '', '' );
        }
-       
+
        static function categoryLinkHook( $parser, $holders, $markers,
                        Title $title, $titleText, &$sortText = null, &$leadingColon = false ) {
                global $wgContLang;
@@ -48,5 +48,5 @@ class CoreLinkFunctions {
                $parser->mOutput->addCategory( $title->getDBkey(), $sortText );
                return '';
        }
-       
+
 }
index 3ad417b..4104289 100644 (file)
@@ -307,7 +307,7 @@ class LinkHolderArray {
                $threshold = $this->getStubThreshold();
                $titlesToBeConverted = '';
                $titlesAttrs = array();
-               
+
                // Concatenate titles to a single string, thus we only need auto convert the
                // single string to all variants. This would improve parser's performance
                // significantly.
@@ -322,14 +322,14 @@ class LinkHolderArray {
                                                'ns' => $ns,
                                                'key' => "$ns:$index",
                                                'titleText' => $titleText,
-                                       );                                      
+                                       );
                                        // separate titles with \0 because it would never appears
                                        // in a valid title
                                        $titlesToBeConverted .= $titleText . "\0";
                                }
                        }
                }
-               
+
                // Now do the conversion and explode string to text of titles
                $titlesAllVariants = $wgContLang->autoConvertToAllVariants( $titlesToBeConverted );
                $allVariantsName = array_keys( $titlesAllVariants );
index 180496d..3dfd3e1 100644 (file)
@@ -5,7 +5,7 @@
  * @file
  * @ingroup Parser
  */
+
 /**
  * @ingroup Parser
  */
@@ -40,7 +40,7 @@ class Preprocessor_DOM implements Preprocessor {
                $xml = "<list>";
 
                foreach ( $values as $k => $val ) {
-                        
+
                        if ( is_int( $k ) ) {
                                $xml .= "<part><name index=\"$k\"/><value>" . htmlspecialchars( $val ) ."</value></part>";
                        } else {
@@ -95,7 +95,7 @@ class Preprocessor_DOM implements Preprocessor {
        function preprocessToObj( $text, $flags = 0 ) {
                wfProfileIn( __METHOD__ );
                global $wgMemc, $wgPreprocessorCacheThreshold;
-               
+
                $xml = false;
                $cacheable = $wgPreprocessorCacheThreshold !== false && strlen( $text ) > $wgPreprocessorCacheThreshold;
                if ( $cacheable ) {
@@ -146,7 +146,7 @@ class Preprocessor_DOM implements Preprocessor {
                wfProfileOut( __METHOD__ );
                return $obj;
        }
-       
+
        function preprocessToXml( $text, $flags = 0 ) {
                wfProfileIn( __METHOD__ );
                $rules = array(
@@ -388,8 +388,8 @@ class Preprocessor_DOM implements Preprocessor {
                                } else {
                                        $attrEnd = $tagEndPos;
                                        // Find closing tag
-                                       if ( preg_match( "/<\/" . preg_quote( $name, '/' ) . "\s*>/i", 
-                                                       $text, $matches, PREG_OFFSET_CAPTURE, $tagEndPos + 1 ) ) 
+                                       if ( preg_match( "/<\/" . preg_quote( $name, '/' ) . "\s*>/i",
+                                                       $text, $matches, PREG_OFFSET_CAPTURE, $tagEndPos + 1 ) )
                                        {
                                                $inner = substr( $text, $tagEndPos + 1, $matches[0][1] - $tagEndPos - 1 );
                                                $i = $matches[0][1] + strlen( $matches[0][0] );
@@ -654,7 +654,7 @@ class Preprocessor_DOM implements Preprocessor {
                $xml = $stack->rootAccum;
 
                wfProfileOut( __METHOD__ );
-               
+
                return $xml;
        }
 }
@@ -1057,11 +1057,11 @@ class PPFrame_DOM implements PPFrame {
                                        # Heading
                                        $s = $this->expand( $contextNode->childNodes, $flags );
 
-                    # Insert a heading marker only for <h> children of <root>
-                    # This is to stop extractSections from going over multiple tree levels
-                    if ( $contextNode->parentNode->nodeName == 'root'
-                      && $this->parser->ot['html'] )
-                    {
+                                       # Insert a heading marker only for <h> children of <root>
+                                       # This is to stop extractSections from going over multiple tree levels
+                                       if ( $contextNode->parentNode->nodeName == 'root'
+                                         && $this->parser->ot['html'] )
+                                       {
                                                # Insert heading index marker
                                                $headingIndex = $contextNode->getAttribute( 'i' );
                                                $titleText = $this->title->getPrefixedDBkey();
@@ -1320,7 +1320,7 @@ class PPTemplateFrame_DOM extends PPFrame_DOM {
                }
                return $arguments;
        }
-       
+
        function getNumberedArguments() {
                $arguments = array();
                foreach ( array_keys($this->numberedArgs) as $key ) {
@@ -1328,7 +1328,7 @@ class PPTemplateFrame_DOM extends PPFrame_DOM {
                }
                return $arguments;
        }
-       
+
        function getNamedArguments() {
                $arguments = array();
                foreach ( array_keys($this->namedArgs) as $key ) {
index f77fc34..14b568c 100644 (file)
@@ -168,13 +168,13 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                $this->typeInfo = self::$allowedTypes[$this->typeName];
 
                # If we have revisions, get the title from the first one
-               # since they should all be from the same page. This allows 
+               # since they should all be from the same page. This allows
                # for more flexibility with page moves...
                if( $this->typeName == 'revision' ) {
                        $rev = Revision::newFromId( $this->ids[0] );
                        $this->targetObj = $rev ? $rev->getTitle() : $this->targetObj;
                }
-               
+
                $this->otherReason = $wgRequest->getVal( 'wpReason' );
                # We need a target page!
                if( is_null($this->targetObj) ) {
@@ -201,7 +201,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                } else {
                        $this->showForm();
                }
-               
+
                $qc = $this->getLogQueryCond();
                # Show relevant lines from the deletion log
                $wgOut->addHTML( "<h2>" . htmlspecialchars( LogPage::logName( 'delete' ) ) . "</h2>\n" );
@@ -337,7 +337,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
        }
 
        /**
-        * Show a list of items that we will operate on, and show a form with checkboxes 
+        * Show a list of items that we will operate on, and show a form with checkboxes
         * which will allow the user to choose new visibility settings.
         */
        protected function showForm() {
@@ -373,7 +373,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                        $wgOut->showErrorPage( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
                        return;
                }
-               
+
                $wgOut->addHTML( "</ul>" );
                // Explanation text
                $this->addUsageText();
@@ -384,7 +384,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                // Show form if the user can submit
                if( $this->mIsAllowed ) {
                        $out = Xml::openElement( 'form', array( 'method' => 'post',
-                                       'action' => $this->getTitle()->getLocalUrl( array( 'action' => 'submit' ) ), 
+                                       'action' => $this->getTitle()->getLocalUrl( array( 'action' => 'submit' ) ),
                                        'id' => 'mw-revdel-form-revisions' ) ) .
                                Xml::fieldset( wfMsg( 'revdelete-legend' ) ) .
                                $this->buildCheckBoxes() .
@@ -453,7 +453,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                        $wgOut->addWikiMsg( 'revdelete-confirm' );
                }
        }
-       
+
        /**
        * @return String: HTML
        */
@@ -503,7 +503,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                                $html .= "<tr>$line</tr>\n";
                        }
                }
-               
+
                $html .= '</table>';
                return $html;
        }
@@ -586,7 +586,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                }
                return $bitfield;
        }
-       
+
        /**
         * Put together a rev_deleted bitfield
         * @param $bitPars array extractBitParams() params
index 07e3619..50ac78a 100644 (file)
@@ -2730,11 +2730,11 @@ class Language {
        function getPreferredVariant() {
                return $this->mConverter->getPreferredVariant();
        }
-       
+
        function getDefaultVariant() {
                return $this->mConverter->getDefaultVariant();
        }
-       
+
        function getURLVariant() {
                return $this->mConverter->getURLVariant();
        }
index d6da950..9e85704 100644 (file)
@@ -11,59 +11,59 @@ class ApiQueryTest extends ApiTestSetup {
                parent::setUp();
                $this->doLogin();
        }
-       
+
        function testTitlesGetNormalized() {
-               
+
                global $wgSitename;
-               
+
                $data = $this->doApiRequest( array(
                        'action' => 'query',
                        'titles' => 'Project:articleA|article_B' ) );
-       
-               
+
+
                $this->assertArrayHasKey( 'query', $data[0] );
                $this->assertArrayHasKey( 'normalized', $data[0]['query'] );
-               
-               $this->assertEquals( 
-                       array( 
+
+               $this->assertEquals(
+                       array(
                                'from' => 'Project:articleA',
                                'to' => $wgSitename . ':ArticleA'
                        ),
                        $data[0]['query']['normalized'][0]
                );
-               
-               $this->assertEquals( 
-                       array( 
+
+               $this->assertEquals(
+                       array(
                                'from' => 'article_B',
                                'to' => 'Article B'
                        ),
                        $data[0]['query']['normalized'][1]
                );
-               
+
        }
-       
+
        function testTitlesAreRejectedIfInvalid() {
                $title = false;
                while( !$title || Title::newFromText( $title )->exists() ) {
                        $title = md5( mt_rand( 0, 10000 ) + rand( 0, 999000 ) );
                }
-               
+
                $data = $this->doApiRequest( array(
                        'action' => 'query',
                        'titles' => $title . '|Talk:' ) );
-       
-               
+
+
                $this->assertArrayHasKey( 'query', $data[0] );
                $this->assertArrayHasKey( 'pages', $data[0]['query'] );
                $this->assertEquals( 2, count( $data[0]['query']['pages'] ) );
-               
+
                $this->assertArrayHasKey( -2, $data[0]['query']['pages'] );
                $this->assertArrayHasKey( -1, $data[0]['query']['pages'] );
-               
+
                $this->assertArrayHasKey( 'missing', $data[0]['query']['pages'][-2] );
                $this->assertArrayHasKey( 'invalid', $data[0]['query']['pages'][-1] );
-               
-                               
+
+
        }
 
 }