Exemplo n.º 1
0
 /**
  * Removes all xml entities from a string
  * and convert them to html entities first
  * and remove all html entities afterwards.
  *
  * <code>
  *
  * echo str::unxml('some <em>&#252;ber</em> crazy stuff');
  * // output: some &uuml;ber crazy stuff
  *
  * </code>
  *
  * @param  string  $string
  * @return string
  */
 public static function unxml($string)
 {
     return xml::decode($string);
 }
Exemplo n.º 2
0
 public function testEncodeDecode()
 {
     $expected = 'S&#252;per &#214;nenc&#339;ded &#223;tring';
     $this->assertEquals($expected, xml::encode($this->string));
     $this->assertEquals($this->string, xml::decode($expected));
 }