Merge "build: Bump most devDependencies to latest"
[lhc/web/wiklou.git] / languages / Language.php
index 453a610..85daa14 100644 (file)
@@ -550,7 +550,7 @@ class Language {
         * Get a namespace value by key
         *
         * <code>
-        * $mw_ns = $wgContLang->getNsText( NS_MEDIAWIKI );
+        * $mw_ns = $lang->getNsText( NS_MEDIAWIKI );
         * echo $mw_ns; // prints 'MediaWiki'
         * </code>
         *
@@ -568,7 +568,7 @@ class Language {
         * producing output.
         *
         * <code>
-        * $mw_ns = $wgContLang->getFormattedNsText( NS_MEDIAWIKI_TALK );
+        * $mw_ns = $lang->getFormattedNsText( NS_MEDIAWIKI_TALK );
         * echo $mw_ns; // prints 'MediaWiki talk'
         * </code>
         *
@@ -3014,7 +3014,7 @@ class Language {
         *
         * @return string
         */
-       function normalize( $s ) {
+       public function normalize( $s ) {
                global $wgAllUnicodeFixes;
                $s = UtfNormal\Validator::cleanUp( $s );
                if ( $wgAllUnicodeFixes ) {
@@ -4194,8 +4194,13 @@ class Language {
        /**
         * convert text to different variants of a language.
         *
-        * @param string $text
-        * @return string
+        * @warning Glossary state is maintained between calls. This means
+        *  if you pass unescaped text to this method it can cause an XSS
+        *  in later calls to this method, even if the later calls have properly
+        *  escaped the input. Never feed this method user controlled text that
+        *  is not properly escaped!
+        * @param string $text Content that has been already escaped for use in HTML
+        * @return string HTML
         */
        public function convert( $text ) {
                return $this->mConverter->convert( $text );