}
/**
- * Convert things like é ā or 〗 into real text...
+ * Convert things like é ā or 〗 into normalized(bug 14952) text
*/
- $filteredText = Sanitizer::decodeCharReferences( $text );
+ $filteredText = Sanitizer::decodeCharReferencesAndNormalize( $text );
$t = new Title();
$t->mDbkeyform = str_replace( ' ', '_', $filteredText );
// If the page is form Mediawiki:message/lang, calling wfMsgWeirdKey causes
// the full l10n of that language to be loaded. That takes much memory and
// isn't needed. So we strip the language part away.
- // Also, extension messages which are not loaded, are shown as red, because
- // we don't call MessageCache::loadAllMessages.
list( $basename, /* rest */ ) = explode( '/', $this->mDbkeyform, 2 );
- return wfMsgWeirdKey( $basename ); // known system message
+ return (bool)wfMsgWeirdKey( $basename ); // known system message
default:
return false;
}
return $this->exists() || $this->isAlwaysKnown();
}
+ /**
+ * Does this page have source text?
+ *
+ * @return Boolean
+ */
+ public function hasSourceText() {
+ if ( $this->exists() )
+ return true;
+
+ if ( $this->mNamespace == NS_MEDIAWIKI ) {
+ // If the page doesn't exist but is a known system message, default
+ // message content will be displayed, same for language subpages
+ // Also, if the page is form Mediawiki:message/lang, calling wfMsgWeirdKey
+ // causes the full l10n of that language to be loaded. That takes much
+ // memory and isn't needed. So we strip the language part away.
+ list( $basename, /* rest */ ) = explode( '/', $this->mDbkeyform, 2 );
+ return (bool)wfMsgWeirdKey( $basename );
+ }
+
+ return false;
+ }
+
/**
* Is this in a namespace that allows actual pages?
*