X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FMessage.php;h=4049e114f39b3650a35a0a690745b2d68d3af9dc;hb=9518265c5ca65bd16cfcc0f4ff8ada678b72773c;hp=7dd22c7ceae22cb99dce9ce4a8759cd1c9b5188b;hpb=e2f2da74f2fc798aaa6e70a74e111a1953255790;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Message.php b/includes/Message.php index 7dd22c7cea..4049e114f3 100644 --- a/includes/Message.php +++ b/includes/Message.php @@ -289,7 +289,7 @@ class Message implements MessageSpecifier, Serializable { 'parameters' => $this->parameters, 'format' => $this->format, 'useDatabase' => $this->useDatabase, - 'title' => $this->title, + 'titlestr' => $this->title ? $this->title->getFullText() : null, ] ); } @@ -311,7 +311,15 @@ class Message implements MessageSpecifier, Serializable { $this->format = $data['format']; $this->useDatabase = $data['useDatabase']; $this->language = $data['language'] ? Language::factory( $data['language'] ) : false; - $this->title = $data['title']; + + if ( isset( $data['titlestr'] ) ) { + $this->title = Title::newFromText( $data['titlestr'] ); + } elseif ( isset( $data['title'] ) && $data['title'] instanceof Title ) { + // Old serializations from before December 2018 + $this->title = $data['title']; + } else { + $this->title = null; // Explicit for sanity + } } /**