PageRenderTime 45ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/A/Filter/Htmlspecialchars.php

http://skeleton.googlecode.com/
PHP | 33 lines | 15 code | 5 blank | 13 comment | 0 complexity | a000741de8c296be4f77c4eb06881ddc MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-2.1
  1. <?php
  2. /**
  3. * Alnum.php
  4. *
  5. * @license http://www.opensource.org/licenses/bsd-license.php BSD
  6. * @link http://skeletonframework.com/
  7. */
  8. /**
  9. * A_Filter_Alnum
  10. *
  11. * Filter value with htmlspecialchars() function with provided quote style and character set
  12. *
  13. * @package A_Filter
  14. */
  15. class A_Filter_Htmlspecialchars extends A_Filter_Base
  16. {
  17. public $character_set;
  18. public $escape_quote_style;
  19. public function __construct($escape_quote_style=ENT_QUOTES, $character_set='UTF-8')
  20. {
  21. $this->escape_quote_style = $escape_quote_style;
  22. $this->character_set = $character_set;
  23. }
  24. public function filter()
  25. {
  26. return htmlspecialchars($this->getValue(), $this->escape_quote_style, $this->character_set);
  27. }
  28. }