mediawiki.action.watch.ajax: Don't get wgPageName
[lhc/web/wiklou.git] / includes / Message.php
index 8d4058e..950bcd5 100644 (file)
@@ -659,10 +659,7 @@ class Message {
                # Maybe transform using the full parser
                if ( $this->format === 'parse' ) {
                        $string = $this->parseText( $string );
-                       $m = array();
-                       if ( preg_match( '/^<p>(.*)\n?<\/p>\n?$/sU', $string, $m ) ) {
-                               $string = $m[1];
-                       }
+                       $string = Parser::stripOuterParagraph( $string );
                } elseif ( $this->format === 'block-parse' ) {
                        $string = $this->parseText( $string );
                } elseif ( $this->format === 'text' ) {
@@ -998,7 +995,7 @@ class Message {
         * @throws MWException If message key array is empty.
         */
        protected function fetchMessage() {
-               if ( !isset( $this->message ) ) {
+               if ( $this->message === null ) {
                        $cache = MessageCache::singleton();
                        if ( is_array( $this->key ) ) {
                                if ( !count( $this->key ) ) {
@@ -1057,7 +1054,7 @@ class RawMessage extends Message {
         */
        public function fetchMessage() {
                // Just in case the message is unset somewhere.
-               if ( !isset( $this->message ) ) {
+               if ( $this->message === null ) {
                        $this->message = $this->key;
                }
                return $this->message;