Skip to content

Instantly share code, notes, and snippets.

@abhinavsingh
Created September 12, 2012 16:35
Show Gist options
  • Save abhinavsingh/3707942 to your computer and use it in GitHub Desktop.
Save abhinavsingh/3707942 to your computer and use it in GitHub Desktop.
JAXLXml Constructor Examples showing sanitization of attributes and text
$ ./jaxlctl shell
jaxl 1> $xml_obj = new JAXLXml('msg', array(), '<a href=""></a>');
jaxl 2> echo $xml_obj->to_string();
<msg>&lt;a href=&quot;&quot;&gt;&lt;/a&gt;</msg>
jaxl 3>
jaxl 3> $xml_obj = new JAXLXml('msg', array('a'=>'some < tag data >'), '<a href="javascript:void(0);"></a>');
jaxl 4> echo $xml_obj->to_string();
<msg a="some &lt; tag data &gt;">&lt;a href=&quot;javascript:void(0);&quot;&gt;&lt;/a&gt;</msg>
jaxl 5>
jaxl 5> quit
$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment