Merge "Add line breaks to the output of Special:Watchlist"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 20 Feb 2013 15:30:06 +0000 (15:30 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 20 Feb 2013 15:30:06 +0000 (15:30 +0000)
RELEASE-NOTES-1.21
includes/Message.php
includes/Status.php
includes/api/ApiFormatBase.php
includes/api/ApiQueryPageProps.php
includes/specials/SpecialVersion.php

index 184812c..6143030 100644 (file)
@@ -212,6 +212,7 @@ production.
   iicontinue).
 * Add supports for all pageset capabilities - generators, redirects, converttitles to
   action=purge and action=setnotificationtimestamp.
+* (bug 43251) prop=pageprops&ppprop= now accepts multiple props to query.
 
 === API internal changes in 1.21 ===
 * For debugging only, a new global $wgDebugAPI removes many API restrictions when true.
index 8d8cdee..6e533a3 100644 (file)
@@ -226,6 +226,39 @@ class Message {
                $this->language = $wgLang;
        }
 
+       /**
+        * Returns the message key
+        *
+        * @since 1.21
+        *
+        * @return string
+        */
+       public function getKey() {
+               return $this->key;
+       }
+
+       /**
+        * Returns the message parameters
+        *
+        * @since 1.21
+        *
+        * @return string[]
+        */
+       public function getParams() {
+               return $this->parameters;
+       }
+
+       /**
+        * Returns the message format
+        *
+        * @since 1.21
+        *
+        * @return string
+        */
+       public function getFormat() {
+               return $this->format;
+       }
+
        /**
         * Factory function that is just wrapper for the real constructor. It is
         * intented to be used instead of the real constructor, because it allows
index 4298aee..449b656 100644 (file)
@@ -231,6 +231,10 @@ class Status {
        /**
         * Get the error message as HTML. This is done by parsing the wikitext error
         * message.
+        *
+        * @note: this does not perform a full wikitext to HTML conversion, it merely applies
+        *        a message transformation.
+        * @todo: figure out whether that is actually The Right Thing.
         */
        public function getHTML( $shortContext = false, $longContext = false ) {
                $text = $this->getWikiText( $shortContext, $longContext );
index b9f48b3..a24953a 100644 (file)
@@ -253,7 +253,7 @@ See the <a href='https://www.mediawiki.org/wiki/API'>complete documentation</a>,
        }
 
        /**
-        * Sets whether the pretty-printer should format *bold* and $italics$
+        * Sets whether the pretty-printer should format *bold*
         * @param $help bool
         */
        public function setHelp( $help = true ) {
@@ -269,22 +269,19 @@ See the <a href='https://www.mediawiki.org/wiki/API'>complete documentation</a>,
        protected function formatHTML( $text ) {
                // Escape everything first for full coverage
                $text = htmlspecialchars( $text );
-
                // encode all comments or tags as safe blue strings
                $text = str_replace( '&lt;', '<span style="color:blue;">&lt;', $text );
                $text = str_replace( '&gt;', '&gt;</span>', $text );
-               // identify URLs
-               $protos = wfUrlProtocolsWithoutProtRel();
-               // This regex hacks around bug 13218 (&quot; included in the URL)
-               $text = preg_replace( "#(((?i)$protos).*?)(&quot;)?([ \\'\"<>\n]|&lt;|&gt;|&quot;)#", '<a href="\\1">\\1</a>\\3\\4', $text );
                // identify requests to api.php
                $text = preg_replace( "#api\\.php\\?[^ <\n\t]+#", '<a href="\\0">\\0</a>', $text );
                if ( $this->mHelp ) {
                        // make strings inside * bold
                        $text = preg_replace( "#\\*[^<>\n]+\\*#", '<b>\\0</b>', $text );
-                       // make strings inside $ italic
-                       $text = preg_replace( "#\\$[^<>\n]+\\$#", '<b><i>\\0</i></b>', $text );
                }
+               // identify URLs
+               $protos = wfUrlProtocolsWithoutProtRel();
+               // This regex hacks around bug 13218 (&quot; included in the URL)
+               $text = preg_replace( "#(((?i)$protos).*?)(&quot;)?([ \\'\"<>\n]|&lt;|&gt;|&quot;)#", '<a href="\\1">\\1</a>\\3\\4', $text );
 
                /**
                 * Temporary fix for bad links in help messages. As a special case,
index 9dd2c6a..2de5710 100644 (file)
@@ -60,7 +60,10 @@ class ApiQueryPageProps extends ApiQueryBase {
                }
 
                # Force a sort order to ensure that properties are grouped by page
-               $this->addOption( 'ORDER BY', 'pp_page' );
+               # But only if pp_page is not constant in the WHERE clause.
+               if ( count( $pages ) > 1 ) {
+                       $this->addOption( 'ORDER BY', 'pp_page' );
+               }
 
                $res = $this->select( __METHOD__ );
                $currentPage = 0; # Id of the page currently processed
@@ -122,14 +125,16 @@ class ApiQueryPageProps extends ApiQueryBase {
        public function getAllowedParams() {
                return array(
                        'continue' => null,
-                       'prop' => null,
+                       'prop' => array(
+                               ApiBase::PARAM_ISMULTI => true,
+                       ),
                );
        }
 
        public function getParamDescription() {
                return array(
                        'continue' => 'When more results are available, use this to continue',
-                       'prop' => 'Page prop to look on the page for. Useful for checking whether a certain page uses a certain page prop.'
+                       'prop' => 'Only list these props. Useful for checking whether a certain page uses a certain page prop',
                );
        }
 
index b04f1ef..88d647e 100644 (file)
@@ -594,8 +594,7 @@ class SpecialVersion extends SpecialPage {
         */
        private function IPInfo() {
                $ip = str_replace( '--', ' - ', htmlspecialchars( $this->getRequest()->getIP() ) );
-               return "<!-- visited from $ip -->\n" .
-                       "<span style='display:none'>visited from $ip</span>";
+               return "<!-- visited from $ip -->\n<span style='display:none'>visited from $ip</span>";
        }
 
        /**