class Horde_Notification_Event_Status extends Horde_Notification_Event
{
/**
+ * Charset of the message.
+ *
+ * @var string
+ */
+ public $charset = null;
+
+ /**
* String representation of this object.
*
* @return string String representation.
{
$text = $this->message;
- if (!in_array('content.raw', $this->flags) && class_exists('Horde_Nls')) {
- $text = htmlspecialchars($text, ENT_COMPAT, $GLOBALS['registry']->getCharset());
+ if (!in_array('content.raw', $this->flags)) {
+ $text = htmlspecialchars($text, ENT_COMPAT, $charset);
}
return $text;
{
public function testMethodTostringHasResultTheTextOfTheEvent()
{
- if (!class_exists('Horde_Nls')) {
- $this->markTestSkipped('The Horde_Nls class is not available!');
- }
- $GLOBALS['registry']->setCharset('ISO-8859-1');
$event = new Horde_Notification_Event_Status('<b>test</b>');
+ $event->charset = 'ISO-8859-1';
$this->assertEquals('<b>test</b>', (string) $event);
}