Various fixes for phan-taint-check
[lhc/web/wiklou.git] / includes / specials / SpecialRecentchanges.php
index 170f792..d274c88 100644 (file)
@@ -674,11 +674,11 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
         * Creates the choose namespace selection
         *
         * @param FormOptions $opts
-        * @return string
+        * @return string[]
         */
        protected function namespaceFilterForm( FormOptions $opts ) {
                $nsSelect = Html::namespaceSelector(
-                       [ 'selected' => $opts['namespace'], 'all' => '' ],
+                       [ 'selected' => $opts['namespace'], 'all' => '', 'in-user-lang' => true ],
                        [ 'name' => 'namespace', 'id' => 'namespace' ]
                );
                $nsLabel = Xml::label( $this->msg( 'namespace' )->text(), 'namespace' );
@@ -709,7 +709,7 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
 
                $categories = array_map( 'trim', explode( '|', $opts['categories'] ) );
 
-               if ( !count( $categories ) ) {
+               if ( $categories === [] ) {
                        return;
                }
 
@@ -744,7 +744,7 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
                }
 
                # Shortcut?
-               if ( !count( $articles ) || !count( $cats ) ) {
+               if ( $articles === [] || $cats === [] ) {
                        return;
                }
 
@@ -800,7 +800,11 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
                $note = '';
                $msg = $this->msg( 'rclegend' );
                if ( !$msg->isDisabled() ) {
-                       $note .= '<div class="mw-rclegend">' . $msg->parse() . "</div>\n";
+                       $note .= Html::rawElement(
+                               'div',
+                               [ 'class' => 'mw-rclegend' ],
+                               $msg->parse()
+                       );
                }
 
                $lang = $this->getLanguage();
@@ -898,14 +902,21 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
                $datenow = $lang->userDate( $timestamp, $user );
                $pipedLinks = '<span class="rcshowhide">' . $lang->pipeList( $links ) . '</span>';
 
-               $rclinks = '<span class="rclinks">' . $this->msg( 'rclinks' )->rawParams( $cl, $dl, '' )
-                       ->parse() . '</span>';
+               $rclinks = Html::rawElement(
+                       'span',
+                       [ 'class' => 'rclinks' ],
+                       $this->msg( 'rclinks' )->rawParams( $cl, $dl, '' )->parse()
+               );
 
-               $rclistfrom = '<span class="rclistfrom">' . $this->makeOptionsLink(
-                       $this->msg( 'rclistfrom' )->rawParams( $now, $timenow, $datenow )->parse(),
-                       [ 'from' => $timestamp ],
-                       $nondefaults
-               ) . '</span>';
+               $rclistfrom = Html::rawElement(
+                       'span',
+                       [ 'class' => 'rclistfrom' ],
+                       $this->makeOptionsLink(
+                               $this->msg( 'rclistfrom' )->plaintextParams( $now, $timenow, $datenow )->parse(),
+                               [ 'from' => $timestamp ],
+                               $nondefaults
+                       )
+               );
 
                return "{$note}$rclinks<br />$pipedLinks<br />$rclistfrom";
        }