Merge "Never prefix table names with $wgSharedDB when used in foreign DB"
[lhc/web/wiklou.git] / includes / api / ApiFormatBase.php
index b9f48b3..b89fb3a 100644 (file)
@@ -38,7 +38,7 @@ abstract class ApiFormatBase extends ApiBase {
         * Constructor
         * If $format ends with 'fm', pretty-print the output in HTML.
         * @param $main ApiMain
-        * @param $format string Format name
+        * @param string $format Format name
         */
        public function __construct( $main, $format ) {
                parent::__construct( $main, $format );
@@ -83,9 +83,9 @@ abstract class ApiFormatBase extends ApiBase {
         * special-case fix that should be removed once the help has been
         * reworked to use a fully HTML interface.
         *
-        * @param $b bool Whether or not ampersands should be escaped.
+        * @param bool $b Whether or not ampersands should be escaped.
         */
-       public function setUnescapeAmps ( $b ) {
+       public function setUnescapeAmps( $b ) {
                $this->mUnescapeAmps = $b;
        }
 
@@ -127,7 +127,7 @@ abstract class ApiFormatBase extends ApiBase {
         * A human-targeted notice about available formats is printed for the HTML-based output,
         * except for help screens (caused by either an error in the API parameters,
         * the calling of action=help, or requesting the root script api.php).
-        * @param $isHelpScreen bool Whether a help screen is going to be shown
+        * @param bool $isHelpScreen Whether a help screen is going to be shown
         */
        function initPrinter( $isHelpScreen ) {
                if ( $this->mDisabled ) {
@@ -170,12 +170,12 @@ abstract class ApiFormatBase extends ApiBase {
 ?>
 <br />
 <small>
-You are looking at the HTML representation of the <?php echo( $this->mFormat ); ?> format.<br />
+You are looking at the HTML representation of the <?php echo $this->mFormat; ?> format.<br />
 HTML is good for debugging, but is unsuitable for application use.<br />
 Specify the format parameter to change the output format.<br />
-To see the non HTML representation of the <?php echo( $this->mFormat ); ?> format, set format=<?php echo( strtolower( $this->mFormat ) ); ?>.<br />
+To see the non HTML representation of the <?php echo $this->mFormat; ?> format, set format=<?php echo strtolower( $this->mFormat ); ?>.<br />
 See the <a href='https://www.mediawiki.org/wiki/API'>complete documentation</a>, or
-<a href='<?php echo( $script ); ?>'>API help</a> for more information.
+<a href='<?php echo $script; ?>'>API help</a> for more information.
 </small>
 <pre style='white-space: pre-wrap;'>
 <?php
@@ -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,
@@ -329,7 +326,7 @@ class ApiFormatFeedWrapper extends ApiFormatBase {
         * Call this method to initialize output data. See execute()
         * @param $result ApiResult
         * @param $feed object an instance of one of the $wgFeedClasses classes
-        * @param $feedItems array of FeedItem objects
+        * @param array $feedItems of FeedItem objects
         */
        public static function setResult( $result, $feed, $feedItems ) {
                // Store output in the Result data.