Merge "Remove methods from SpecialPage deprecated in 1.17 and 1.18"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sun, 5 Jan 2014 04:53:17 +0000 (04:53 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sun, 5 Jan 2014 04:53:17 +0000 (04:53 +0000)
16 files changed:
includes/Title.php
includes/changes/EnhancedChangesList.php
includes/db/DatabaseSqlite.php
includes/specials/SpecialBlock.php
includes/specials/SpecialProtectedpages.php
languages/messages/MessagesEn.php
languages/messages/MessagesFr.php
languages/messages/MessagesQqq.php
maintenance/fixDoubleRedirects.php
maintenance/language/messages.inc
resources/Resources.php
resources/mediawiki.special/mediawiki.special.block.css [new file with mode: 0644]
resources/mediawiki/images/arrow-collapsed-ltr.svg
resources/mediawiki/images/arrow-collapsed-rtl.svg
resources/mediawiki/images/arrow-expanded.svg
tests/phpunit/includes/TestUser.php

index 88268bb..d300513 100644 (file)
@@ -3891,6 +3891,7 @@ class Title {
 
                if ( $moveOverRedirect ) {
                        $newid = $nt->getArticleID();
+                       $newcontent = $newpage->getContent();
 
                        # Delete the old redirect. We don't save it to history since
                        # by definition if we've got here it's rather uninteresting.
@@ -3898,7 +3899,7 @@ class Title {
                        # a conflict on the unique namespace+title index...
                        $dbw->delete( 'page', array( 'page_id' => $newid ), __METHOD__ );
 
-                       $newpage->doDeleteUpdates( $newid );
+                       $newpage->doDeleteUpdates( $newid, $newcontent );
                }
 
                # Save a null revision in the page's history notifying of the move
index 99cf0de..42b112c 100644 (file)
  */
 
 class EnhancedChangesList extends ChangesList {
-
+       /** @var array Array of array of RCCacheEntry */
        protected $rc_cache;
 
        /**
         * Add the JavaScript file for enhanced changeslist
-        * @return String
+        * @return string
         */
        public function beginRecentChangesList() {
                $this->rc_cache = array();
@@ -50,8 +50,8 @@ class EnhancedChangesList extends ChangesList {
        /**
         * Format a line for enhanced recentchange (aka with javascript and block of lines).
         *
-        * @param $baseRC RecentChange
-        * @param $watched bool
+        * @param RecentChange $baseRC
+        * @param bool $watched
         *
         * @return string
         */
@@ -90,6 +90,7 @@ class EnhancedChangesList extends ChangesList {
 
                // Page moves, very old style, not supported anymore
                if ( $type == RC_MOVE || $type == RC_MOVE_OVER_REDIRECT ) {
+                       $clink = '';
                // New unpatrolled pages
                } elseif ( $cacheEntry->unpatrolled && $type == RC_NEW ) {
                        $clink = Linker::linkKnown( $cacheEntry->getTitle() );
@@ -209,6 +210,7 @@ class EnhancedChangesList extends ChangesList {
 
        /**
         * Enhanced RC group
+        * @param RCCacheEntry[] $block
         * @return string
         */
        protected function recentChangesBlockGroup( $block ) {
@@ -242,6 +244,7 @@ class EnhancedChangesList extends ChangesList {
                # Some catalyst variables...
                $namehidden = true;
                $allLogs = true;
+               $oldid = '';
                foreach ( $block as $rcObj ) {
                        $oldid = $rcObj->mAttribs['rc_last_oldid'];
                        if ( $rcObj->mAttribs['rc_type'] == RC_NEW ) {
@@ -341,6 +344,7 @@ class EnhancedChangesList extends ChangesList {
 
                $sinceLast = 0;
                $unvisitedOldid = null;
+               /** @var $rcObj RCCacheEntry */
                foreach ( $block as $rcObj ) {
                        // Same logic as below inside main foreach
                        if ( $rcObj->watched && $rcObj->mAttribs['rc_timestamp'] >= $rcObj->watched ) {
@@ -356,6 +360,8 @@ class EnhancedChangesList extends ChangesList {
                # Total change link
                $r .= ' ';
                $logtext = '';
+               /** @var $block0 RecentChange */
+               $block0 = $block[0];
                if ( !$allLogs ) {
                        if ( !ChangesList::userCan( $rcObj, Revision::DELETED_TEXT, $this->getUser() ) ) {
                                $logtext .= $nchanges[$n];
@@ -363,7 +369,7 @@ class EnhancedChangesList extends ChangesList {
                                $logtext .= $nchanges[$n];
                        } else {
                                $logtext .= Linker::link(
-                                       $block[0]->getTitle(),
+                                       $block0->getTitle(),
                                        $nchanges[$n],
                                        array(),
                                        $queryParams + array(
@@ -374,7 +380,7 @@ class EnhancedChangesList extends ChangesList {
                                );
                                if ( $sinceLast > 0 && $sinceLast < $n ) {
                                        $logtext .= $this->message['pipe-separator'] . Linker::link(
-                                               $block[0]->getTitle(),
+                                               $block0->getTitle(),
                                                $sinceLastVisitMsg[$sinceLast],
                                                array(),
                                                $queryParams + array(
@@ -390,7 +396,7 @@ class EnhancedChangesList extends ChangesList {
                # History
                if ( $allLogs ) {
                        // don't show history link for logs
-               } elseif ( $namehidden || !$block[0]->getTitle()->exists() ) {
+               } elseif ( $namehidden || !$block0->getTitle()->exists() ) {
                        $logtext .= $this->message['pipe-separator'] . $this->message['enhancedrc-history'];
                } else {
                        $params = $queryParams;
@@ -398,7 +404,7 @@ class EnhancedChangesList extends ChangesList {
 
                        $logtext .= $this->message['pipe-separator'] .
                                Linker::linkKnown(
-                                       $block[0]->getTitle(),
+                                       $block0->getTitle(),
                                        $this->message['enhancedrc-history'],
                                        array(),
                                        $params
@@ -433,7 +439,7 @@ class EnhancedChangesList extends ChangesList {
                }
 
                $r .= $users;
-               $r .= $this->numberofWatchingusers( $block[0]->numberofWatchingusers );
+               $r .= $this->numberofWatchingusers( $block0->numberofWatchingusers );
                $r .= '</td></tr>';
 
                # Sub-entries
@@ -524,10 +530,10 @@ class EnhancedChangesList extends ChangesList {
 
        /**
         * Generate HTML for an arrow or placeholder graphic
-        * @param string $dir one of '', 'd', 'l', 'r'
-        * @param string $alt text
-        * @param string $title text
-        * @return String: HTML "<img>" tag
+        * @param string $dir One of '', 'd', 'l', 'r'
+        * @param string $alt
+        * @param string $title
+        * @return string HTML "<img>" tag
         */
        protected function arrow( $dir, $alt = '', $title = '' ) {
                global $wgStylePath;
@@ -541,7 +547,7 @@ class EnhancedChangesList extends ChangesList {
        /**
         * Generate HTML for a right- or left-facing arrow,
         * depending on language direction.
-        * @return String: HTML "<img>" tag
+        * @return string HTML "<img>" tag
         */
        protected function sideArrow() {
                $dir = $this->getLanguage()->isRTL() ? 'l' : 'r';
@@ -552,7 +558,7 @@ class EnhancedChangesList extends ChangesList {
        /**
         * Generate HTML for a down-facing arrow
         * depending on language direction.
-        * @return String: HTML "<img>" tag
+        * @return string HTML "<img>" tag
         */
        protected function downArrow() {
                return $this->arrow( 'd', '-', $this->msg( 'rc-enhanced-hide' )->text() );
@@ -560,7 +566,7 @@ class EnhancedChangesList extends ChangesList {
 
        /**
         * Generate HTML for a spacer image
-        * @return String: HTML "<img>" tag
+        * @return string HTML "<img>" tag
         */
        protected function spacerArrow() {
                return $this->arrow( '', codepointToUtf8( 0xa0 ) ); // non-breaking space
@@ -569,8 +575,8 @@ class EnhancedChangesList extends ChangesList {
        /**
         * Enhanced RC ungrouped line.
         *
-        * @param $rcObj RecentChange
-        * @return String: a HTML formatted line (generated using $r)
+        * @param RecentChange|RCCacheEntry $rcObj
+        * @return string A HTML formatted line (generated using $r)
         */
        protected function recentChangesBlockLine( $rcObj ) {
                global $wgRCShowChangedSize;
index 89f0818..ea35391 100644 (file)
  * @ingroup Database
  */
 class DatabaseSqlite extends DatabaseBase {
+       /** @var bool Whether full text is enabled */
        private static $fulltextEnabled = null;
 
-       var $mAffectedRows;
-       var $mLastResult;
-       var $mDatabaseFile;
-       var $mName;
+       /** @var string File name for SQLite database file */
+       public $mDatabaseFile;
+
+       /** @var int The number of rows affected as an integer */
+       protected $mAffectedRows;
+
+       /** @var resource */
+       protected $mLastResult;
 
        /**
-        * @var PDO
+        * @var string
+        * @todo Seems to serve no purpose. Remove?
         */
+       private $mName;
+
+       /** @var PDO */
        protected $mConn;
 
        function __construct( $p = null ) {
index fa5ec29..1aa8006 100644 (file)
@@ -296,14 +296,14 @@ class SpecialBlock extends FormSpecialPage {
                if ( $this->requestedHideUser ) {
                        $fields['Confirm']['type'] = 'check';
                        unset( $fields['Confirm']['default'] );
-                       $this->preErrors[] = 'ipb-confirmhideuser';
+                       $this->preErrors[] = array( 'ipb-confirmhideuser', 'ipb-confirmaction' );
                }
 
                # Or if the user is trying to block themselves
                if ( (string)$this->target === $this->getUser()->getName() ) {
                        $fields['Confirm']['type'] = 'check';
                        unset( $fields['Confirm']['default'] );
-                       $this->preErrors[] = 'ipb-blockingself';
+                       $this->preErrors[] = array( 'ipb-blockingself', 'ipb-confirmaction' );
                }
        }
 
@@ -630,7 +630,7 @@ class SpecialBlock extends FormSpecialPage {
                        if ( $target === $performer->getName() &&
                                ( $data['PreviousTarget'] !== $target || !$data['Confirm'] )
                        ) {
-                               return array( 'ipb-blockingself' );
+                               return array( 'ipb-blockingself', 'ipb-confirmaction' );
                        }
                } elseif ( $type == Block::TYPE_RANGE ) {
                        $userId = 0;
@@ -678,7 +678,7 @@ class SpecialBlock extends FormSpecialPage {
                                # Disallow hiding users with many edits for performance.
                                return array( 'ipb_hide_invalid' );
                        } elseif ( !$data['Confirm'] ) {
-                               return array( 'ipb-confirmhideuser' );
+                               return array( 'ipb-confirmhideuser', 'ipb-confirmaction' );
                        }
                }
 
index 214fbd9..09284d0 100644 (file)
@@ -425,8 +425,8 @@ class ProtectedPagesPager extends AlphabeticPager {
 
        function getQueryInfo() {
                $conds = $this->mConds;
-               $conds[] = '(pr_expiry>' . $this->mDb->addQuotes( $this->mDb->timestamp() ) .
-                       'OR pr_expiry IS NULL)';
+               $conds[] = 'pr_expiry > ' . $this->mDb->addQuotes( $this->mDb->timestamp() ) .
+                       'OR pr_expiry IS NULL';
                $conds[] = 'page_id=pr_page';
                $conds[] = 'pr_type=' . $this->mDb->addQuotes( $this->type );
 
index 1ede09f..04d7ced 100644 (file)
@@ -3306,6 +3306,7 @@ Fill in a specific reason below (for example, citing particular pages that were
 See the [[Special:BlockList|block list]] to review blocks.',
 'ipb-blockingself'                => 'You are about to block yourself! Are you sure you want to do that?',
 'ipb-confirmhideuser'             => 'You are about to block a user with "hide user" enabled. This will suppress the user\'s name in all lists and log entries. Are you sure you want to do that?',
+'ipb-confirmaction'               => 'If you are sure you really want to do it, please check the "{{int:ipb-confirm}}" field at the bottom.',
 'ipb-edit-dropdown'               => 'Edit block reasons',
 'ipb-unblock-addr'                => 'Unblock $1',
 'ipb-unblock'                     => 'Unblock a username or IP address',
index c24aa95..3b298ca 100644 (file)
@@ -132,6 +132,11 @@ $namespaceAliases = array(
        'Discussion_Catégorie' => NS_CATEGORY_TALK
 );
 
+$namespaceGenderAliases = array(
+       NS_USER => array( 'male' => 'Utilisateur', 'female' => 'Utilisatrice' ),
+       NS_USER_TALK => array( 'male' => 'Discussion_utilisateur', 'female' => 'Discussion_utilisatrice' ),
+);
+
 $specialPageAliases = array(
        'Activeusers'               => array( 'Utilisateurs_actifs', 'UtilisateursActifs' ),
        'Allmessages'               => array( 'Messages_système', 'Messages_systeme', 'Messagessystème', 'Messagessysteme' ),
index 22e7af0..48c0727 100644 (file)
@@ -6345,6 +6345,11 @@ See also:
 
 See also:
 * {{msg-mw|Ipb-blockingself}}',
+'ipb-confirmaction' => 'Used to inform the user they need to check the "Confirm block" checkbox on [[Special:Block]] ({{mw-msg|ipb-confirm}}) to continue.
+
+See also:
+* {{msg-mw|Ipb-blockingself}}
+* {{msg-mw|Ipb-confirmhideuser}}',
 'ipb-edit-dropdown' => 'Shown beneath the user block form on the right side. It is a link to {{msg-mw|Ipbreason-dropdown|notext=1}}.
 
 See also:
index 523be7e..8ae5a5a 100644 (file)
@@ -71,7 +71,7 @@ class FixDoubleRedirects extends Maintenance {
                        'rd_from = pa.page_id',
                        'rd_namespace = pb.page_namespace',
                        'rd_title = pb.page_title',
-                       '(rd_interwiki IS NULL OR rd_interwiki = "")', // bug 40352
+                       'rd_interwiki IS NULL OR rd_interwiki = ' . $dbr->addQuotes( '' ), // bug 40352
                        'pb.page_is_redirect' => 1,
                );
 
index 2742979..d9ef44a 100644 (file)
@@ -2277,6 +2277,7 @@ $wgMessageStructure = array(
                'blockipsuccesstext',
                'ipb-blockingself',
                'ipb-confirmhideuser',
+               'ipb-confirmaction',
                'ipb-edit-dropdown',
                'ipb-unblock-addr',
                'ipb-unblock',
index 3fa1864..4489ddb 100644 (file)
@@ -1054,6 +1054,7 @@ return array(
        ),
        'mediawiki.special.block' => array(
                'scripts' => 'resources/mediawiki.special/mediawiki.special.block.js',
+               'styles' => 'resources/mediawiki.special/mediawiki.special.block.css',
                'dependencies' => array(
                        'mediawiki.util',
                ),
diff --git a/resources/mediawiki.special/mediawiki.special.block.css b/resources/mediawiki.special/mediawiki.special.block.css
new file mode 100644 (file)
index 0000000..899a9f3
--- /dev/null
@@ -0,0 +1,7 @@
+/**
+ * Styling for Special:Block
+ */
+
+label[for="mw-input-wpConfirm"] {
+       font-weight: bold;
+}
index 0855534..15992f8 100644 (file)
@@ -1 +1,61 @@
-<?xml version="1.0" ?><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12"><path d="M4 1.533v9.671l4.752-4.871z" fill="#797979"/></svg>
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   version="1.1"
+   width="12"
+   height="12"
+   id="svg2"
+   inkscape:version="0.48.4 r9939"
+   sodipodi:docname="arrow-collapsed-ltr.svg">
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="1920"
+     inkscape:window-height="1041"
+     id="namedview7"
+     showgrid="false"
+     inkscape:zoom="27.812867"
+     inkscape:cx="7.833847"
+     inkscape:cy="7.3054094"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="svg2" />
+  <defs
+     id="defs4" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     transform="matrix(1.0559311,0,0,1.0825058,-404.86649,-609.71107)"
+     id="layer1">
+    <path
+       d="m 387.20944,564.65683 0,8.93354 4.49986,-4.49987 z"
+       id="arrow"
+       style="fill:#797979;fill-opacity:1;stroke:none"
+       inkscape:connector-curvature="0" />
+  </g>
+</svg>
index b22b3fc..a643689 100644 (file)
@@ -1 +1,61 @@
-<?xml version="1.0" ?><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12"><path d="M8 1.533v9.671l-4.752-4.871z" fill="#797979"/></svg>
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   version="1.1"
+   width="12"
+   height="12"
+   id="svg2"
+   inkscape:version="0.48.4 r9939"
+   sodipodi:docname="arrow-collapsed-ltr.svg">
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="1920"
+     inkscape:window-height="1041"
+     id="namedview7"
+     showgrid="false"
+     inkscape:zoom="27.812867"
+     inkscape:cx="14.764482"
+     inkscape:cy="6.45175"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="svg2" />
+  <defs
+     id="defs4" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     transform="matrix(-1.0559311,0,0,1.0825058,416.86649,-609.71107)"
+     id="layer1">
+    <path
+       d="m 387.20944,564.65683 0,8.93354 4.49986,-4.49987 z"
+       id="arrow"
+       style="fill:#797979;fill-opacity:1;stroke:none"
+       inkscape:connector-curvature="0" />
+  </g>
+</svg>
index e255dba..4012bb5 100644 (file)
@@ -1 +1,61 @@
-<?xml version="1.0" ?><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12"><path d="M1.165 3.624h9.671l-4.871 4.752z" fill="#797979"/></svg>
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   version="1.1"
+   width="12"
+   height="12"
+   id="svg2"
+   inkscape:version="0.48.4 r9939"
+   sodipodi:docname="arrow-collapsed-rtl.svg">
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="1920"
+     inkscape:window-height="1041"
+     id="namedview7"
+     showgrid="false"
+     inkscape:zoom="27.812867"
+     inkscape:cx="9.7488178"
+     inkscape:cy="6.45175"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="svg2" />
+  <defs
+     id="defs4" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     transform="matrix(0,1.0559311,1.0825058,0,-610.0796,-405.24226)"
+     id="layer1">
+    <path
+       d="m 387.20944,564.65683 0,8.93354 4.49986,-4.49987 z"
+       id="arrow"
+       style="fill:#797979;fill-opacity:1;stroke:none"
+       inkscape:connector-curvature="0" />
+  </g>
+</svg>
index 23e6503..7d18206 100644 (file)
@@ -45,14 +45,14 @@ class TestUser {
                $this->user->setPassword( $this->password );
                $this->user->setEmail( $this->email );
                $this->user->setRealName( $this->realname );
-               // remove all groups, replace with any groups specified
-               foreach ( $this->user->getGroups() as $group ) {
-                       $this->user->removeGroup( $group );
+
+               // Adjust groups by adding any missing ones and removing any extras
+               $currentGroups = $this->user->getGroups();
+               foreach ( array_diff( $this->groups, $currentGroups ) as $group ) {
+                       $this->user->addGroup( $group );
                }
-               if ( count( $this->groups ) ) {
-                       foreach ( $this->groups as $group ) {
-                               $this->user->addGroup( $group );
-                       }
+               foreach ( array_diff( $currentGroups, $this->groups ) as $group ) {
+                       $this->user->removeGroup( $group );
                }
                $this->user->saveSettings();
        }