$string = $this->fetchMessage();
if ( $string === false ) {
- $key = htmlspecialchars( $this->key );
- if ( $this->format === 'plain' ) {
- return '<' . $key . '>';
+ if ( $this->format === 'plain' || $this->format === 'text' ) {
+ return '<' . $this->key . '>';
}
- return '<' . $key . '>';
+ return '<' . htmlspecialchars( $this->key ) . '>';
}
# Replace $* with a list of parameters for &uselang=qqx.
// Doh! Cause a fatal error after all?
}
- if ( $this->format === 'plain' ) {
+ if ( $this->format === 'plain' || $this->format === 'text' ) {
return '<' . $this->key . '>';
}
- return '<' . $this->key . '>';
+ return '<' . htmlspecialchars( $this->key ) . '>';
}
}
$this->assertInstanceOf( 'Message', wfMessage( 'mainpage' ) );
$this->assertInstanceOf( 'Message', wfMessage( 'i-dont-exist-evar' ) );
$this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->text() );
- $this->assertEquals( '<i-dont-exist-evar>', wfMessage( 'i-dont-exist-evar' )->text() );
+ $this->assertEquals( '<i-dont-exist-evar>', wfMessage( 'i-dont-exist-evar' )->text() );
+ $this->assertEquals( '<i<dont>exist-evar>', wfMessage( 'i<dont>exist-evar' )->text() );
$this->assertEquals( '<i-dont-exist-evar>', wfMessage( 'i-dont-exist-evar' )->plain() );
+ $this->assertEquals( '<i<dont>exist-evar>', wfMessage( 'i<dont>exist-evar' )->plain() );
$this->assertEquals( '<i-dont-exist-evar>', wfMessage( 'i-dont-exist-evar' )->escaped() );
+ $this->assertEquals(
+ '<i<dont>exist-evar>',
+ wfMessage( 'i<dont>exist-evar' )->escaped()
+ );
}
/**