Merge "Add checkDependencies.php"
[lhc/web/wiklou.git] / includes / skins / QuickTemplate.php
index 296c133..6bcf1c3 100644 (file)
@@ -35,7 +35,7 @@ abstract class QuickTemplate {
        protected $config;
 
        /**
-        * @param Config $config
+        * @param Config|null $config
         */
        function __construct( Config $config = null ) {
                $this->data = [];
@@ -63,7 +63,7 @@ abstract class QuickTemplate {
         */
        public function extend( $name, $value ) {
                if ( $this->haveData( $name ) ) {
-                       $this->data[$name] = $this->data[$name] . $value;
+                       $this->data[$name] .= $value;
                } else {
                        $this->data[$name] = $value;
                }
@@ -73,8 +73,9 @@ abstract class QuickTemplate {
         * Gets the template data requested
         * @since 1.22
         * @param string $name Key for the data
-        * @param mixed $default Optional default (or null)
+        * @param mixed|null $default Optional default (or null)
         * @return mixed The value of the data requested or the deafult
+        * @return-taint onlysafefor_htmlnoent
         */
        public function get( $name, $default = null ) {
                return $this->data[$name] ?? $default;
@@ -101,6 +102,7 @@ abstract class QuickTemplate {
        /**
         * @private
         * @param string $str
+        * @suppress SecurityCheck-DoubleEscaped $this->data can be either
         */
        function text( $str ) {
                echo htmlspecialchars( $this->data[$str] );
@@ -109,6 +111,7 @@ abstract class QuickTemplate {
        /**
         * @private
         * @param string $str
+        * @suppress SecurityCheck-XSS phan-taint-check cannot tell if $str is pre-escaped
         */
        function html( $str ) {
                echo $this->data[$str];
@@ -122,24 +125,17 @@ abstract class QuickTemplate {
                echo htmlspecialchars( wfMessage( $msgKey )->text() );
        }
 
-       /**
-        * @private
-        * @param string $msgKey
-        */
-       function msgHtml( $msgKey ) {
-               echo wfMessage( $msgKey )->text();
-       }
-
        /**
         * An ugly, ugly hack.
-        * @private
+        * @deprecated since 1.33 Use ->msg() instead.
         * @param string $msgKey
         */
        function msgWiki( $msgKey ) {
+               // TODO: Add wfDeprecated( __METHOD__, '1.33' ) after 1.33 got released
                global $wgOut;
 
-               $text = wfMessage( $msgKey )->text();
-               echo $wgOut->parse( $text );
+               $text = wfMessage( $msgKey )->plain();
+               echo $wgOut->parseAsInterface( $text );
        }
 
        /**