* $escaped = wfMessage( 'key' )->rawParams( 'apple' )->escaped();
* </pre>
*
- * TODO:
+ * @todo
* - test, can we have tests?
- * - sort out the details marked with fixme
*
* @since 1.17
* @author Niklas Laxström
* @return Message: $this
*/
public function inLanguage( $lang ) {
- if ( $lang instanceof Language || $lang instanceof StubContLang || $lang instanceof StubUserLang ) {
+ if ( $lang instanceof Language || $lang instanceof StubUserLang ) {
$this->language = $lang;
} elseif ( is_string( $lang ) ) {
if( $this->language->getCode() != $lang ) {
} elseif( $this->format === 'text' ){
$string = $this->transformText( $string );
} elseif( $this->format === 'escaped' ){
- # FIXME: Sanitizer method here?
$string = $this->transformText( $string );
- $string = htmlspecialchars( $string );
+ $string = htmlspecialchars( $string, ENT_QUOTES, 'UTF-8', false );
}
# Raw parameter replacement
/**
* Check whether a message does not exist, or is an empty string
* @return Bool: true if is is and false if not
- * @todo Merge with isDisabled()?
+ * @todo FIXME: Merge with isDisabled()?
*/
public function isBlank() {
$message = $this->fetchMessage();
* @return string Wikitext parsed into HTML
*/
protected function parseText( $string ) {
- return MessageCache::singleton()->parse( $string, null, /*linestart*/true, $this->interface, $this->language )->getText();
+ return MessageCache::singleton()->parse( $string, $this->title, /*linestart*/true, $this->interface, $this->language )->getText();
}
/**