Changed Message::content() to pass $this to MessageContent.
authorTyler Anthony Romeo <tylerromeo@gmail.com>
Mon, 28 Jan 2013 04:20:57 +0000 (23:20 -0500)
committerTyler Anthony Romeo <tylerromeo@gmail.com>
Mon, 28 Jan 2013 04:20:57 +0000 (23:20 -0500)
MessageContent can take either a Message or a message key in
the constructor. Since Message::content() is an instance method,
it makes sense to pass the instance itself rather than just
the key. This fixes cases where RawMessage::content() is called,
since passing RawMessage's key to MessageContent will not work
properly.

Change-Id: Ic3b935e5ac997df07eea40b438445ebd5024e306

includes/Message.php

index 96747c9..5ea0277 100644 (file)
@@ -416,7 +416,7 @@ class Message {
         */
        public function content() {
                if ( !$this->content ) {
-                       $this->content = new MessageContent( $this->key );
+                       $this->content = new MessageContent( $this );
                }
 
                return $this->content;