3 * Doesn't do anything other than an XML well-formedness check
5 * @author Ant P. <xmpp:ant@specialops.ath.cx>
7 * @license http://specialops.ath.cx/repos/so2/trunk/COPYING
9 require_once 'lib/iface.Message3.php';
11 class Message_XML
implements Message3
13 private $output = null;
15 function __construct($input, $formatting = null)
17 if ( strpos($input, '<script') !== false ) {
18 throw new Exception('No.');
21 // No nl2br here, anyone using this should know what they're doing
22 $this->output
= str_replace("\r\n", "\n", $input);
27 // Check for malformed XML, doesn't really do much else
28 $parser = xml_parser_create('UTF-8');
30 if ( !xml_parse($parser, '<div>'.$this->output
.'</div>', true) ) {
31 throw new InvalidInputException(xml_error_string(xml_get_error_code($parser)), xml_get_current_line_number($parser));