+ /**
+ * Same as page title but only contains name of the page, not any other text.
+ *
+ * @since 1.32
+ * @param string $html Page title text.
+ * @see OutputPage::setPageTitle
+ */
+ public function setDisplayTitle( $html ) {
+ $this->displayTitle = $html;
+ }
+
+ /**
+ * Returns page display title.
+ *
+ * Performs some normalization, but this not as strict the magic word.
+ *
+ * @since 1.32
+ * @return string HTML
+ */
+ public function getDisplayTitle() {
+ $html = $this->displayTitle;
+ if ( $html === null ) {
+ $html = $this->getTitle()->getPrefixedText();
+ }
+
+ return Sanitizer::normalizeCharReferences( Sanitizer::removeHTMLtags( $html ) );
+ }
+
+ /**
+ * Returns page display title without namespace prefix if possible.
+ *
+ * @since 1.32
+ * @return string HTML
+ */
+ public function getUnprefixedDisplayTitle() {
+ $text = $this->getDisplayTitle();
+ $nsPrefix = $this->getTitle()->getNsText() . ':';
+ $prefix = preg_quote( $nsPrefix, '/' );
+
+ return preg_replace( "/^$prefix/i", '', $text );
+ }
+