Exemplo n.º 1
0
 protected function escapeParameters(array $parameters)
 {
     if (false !== $this->escaper) {
         Escaper::setCharset($this->getCharset());
         $parameters['_data'] = Escaper::escape($this->escaper, $parameters);
         foreach ($parameters['_data'] as $key => $value) {
             $parameters[$key] = $value;
         }
     } else {
         $parameters['_data'] = Escaper::escape('raw', $parameters);
     }
     return $parameters;
 }
Exemplo n.º 2
0
 public static function setUpBeforeClass()
 {
     $a = array('<strong>escaped!</strong>', 1, null, array(2, '<strong>escaped!</strong>'));
     self::$escaped = Escaper::escape('entities', $a);
 }
Exemplo n.º 3
0
 public static function setUpBeforeClass()
 {
     $object = new OutputEscaperTest();
     self::$escaped = Escaper::escape('entities', $object);
 }
Exemplo n.º 4
0
 public function testUnescapeUnescapesMixedArrays()
 {
     $object = new OutputEscaperTestClass();
     $input = array('foo' => 'bar', 'bar' => Escaper::escape('entities', '<strong>bar</strong>'), 'foobar' => Escaper::escape('entities', $object));
     $output = array('foo' => 'bar', 'bar' => '<strong>bar</strong>', 'foobar' => $object);
     $this->assertEquals($output, Escaper::unescape($input), '::unescape() unescapes values with some escaped and unescaped values');
 }