Make $wgDebugRawPage=false also ignore load.php, so that debug logs can be readable...
[lhc/web/wiklou.git] / includes / Message.php
index 69a48b8..5f6e9af 100644 (file)
@@ -48,9 +48,8 @@
  * $escaped = wfMessage( 'key' )->rawParams( 'apple' )->escaped();
  * </pre>
  *
- * TODO:
+ * @todo
  * - test, can we have tests?
- * - sort out the details marked with fixme
  *
  * @since 1.17
  * @author Niklas Laxström
@@ -208,7 +207,7 @@ class Message {
         * @return Message: $this
         */
        public function inLanguage( $lang ) {
-               if ( $lang instanceof Language || $lang instanceof StubContLang || $lang instanceof StubUserLang ) {
+               if ( $lang instanceof Language || $lang instanceof StubUserLang ) {
                        $this->language = $lang;
                } elseif ( is_string( $lang ) ) {
                        if( $this->language->getCode() != $lang ) {
@@ -278,9 +277,8 @@ class Message {
                } elseif( $this->format === 'text' ){
                        $string = $this->transformText( $string );
                } elseif( $this->format === 'escaped' ){
-                       # FIXME: Sanitizer method here?
                        $string = $this->transformText( $string );
-                       $string = htmlspecialchars( $string );
+                       $string = htmlspecialchars( $string, ENT_QUOTES, 'UTF-8', false );
                }
                
                # Raw parameter replacement
@@ -356,7 +354,7 @@ class Message {
        /**
         * Check whether a message does not exist, or is an empty string
         * @return Bool: true if is is and false if not
-        * @todo Merge with isDisabled()?
+        * @todo FIXME: Merge with isDisabled()?
         */
        public function isBlank() {
                $message = $this->fetchMessage();
@@ -432,7 +430,7 @@ class Message {
         * @return string Wikitext parsed into HTML
         */
        protected function parseText( $string ) {
-               return MessageCache::singleton()->parse( $string, null, /*linestart*/true, $this->interface, $this->language )->getText();
+               return MessageCache::singleton()->parse( $string, $this->title, /*linestart*/true, $this->interface, $this->language )->getText();
        }
 
        /**