Hoa central
HtmlEntities.php
Go to the documentation of this file.
1 <?php
2 
46 import('Filter.Abstract');
47 
63 
69  protected $arguments = array(
70  'quoteStyle' => 'specify the quote style, see the PHP constants : ENT_COMPAT, ENT_QUOTES, ENT_NOQUOTES.',
71  'charset' => 'specify charset.',
72  'doubleEncode' => 'specify if PHP make a double encode (true) or not (false).'
73  );
74 
75 
76 
84  public function filter ( $string = null ) {
85 
86  if(PHP_VERSION_ID >= 50203)
87  return htmlentities(
88  (string) $string,
89  $this->getFilterArgument('quoteStyle'),
90  $this->getFilterArgument('charset'),
91  $this->getFilterArgument('doubleEncode')
92  );
93  else
94  return htmlentities(
95  (string) $string,
96  $this->getFilterArgument('quoteStyle'),
97  $this->getFilterArgument('charset')
98  );
99  }
100 }
getFilterArgument($name)
Definition: Abstract.php:146