I18Nv2
[ class tree: I18Nv2 ] [ index: I18Nv2 ] [ all elements ]

Source for file HtmlSpecialchars.php

Documentation is available at HtmlSpecialchars.php

  1. <?php
  2. // +----------------------------------------------------------------------+
  3. // | PEAR :: I18Nv2 :: DecoratedList :: HtmlSpecialchars                  |
  4. // +----------------------------------------------------------------------+
  5. // | This source file is subject to version 3.0 of the PHP license,       |
  6. // | that is available at http://www.php.net/license/3_0.txt              |
  7. // | If you did not receive a copy of the PHP license and are unable      |
  8. // | to obtain it through the world-wide-web, please send a note to       |
  9. // | license@php.net so we can mail you a copy immediately.               |
  10. // +----------------------------------------------------------------------+
  11. // | Copyright (c) 2004 Michael Wallner <mike@iworks.at>                  |
  12. // +----------------------------------------------------------------------+
  13. //
  14. // $Id: HtmlSpecialchars.php,v 1.1 2004/05/05 10:22:22 mike Exp $
  15.  
  16. require_once 'I18Nv2/DecoratedList.php';
  17.  
  18. /**
  19. * I18Nv2_Decorator_HtmlSpecialchars
  20. * 
  21. * When you are going to serve XHTML as XML or XHTML+XML then you will get
  22. * problems while displaying umlauts etc. as their HTML entities.
  23. *
  24. * @author       Michael Wallner <mike@php.net>
  25. * @version      $Revision: 1.1 $
  26. * @package      I18Nv2
  27. */
  28. {
  29.     /** 
  30.     * decorate
  31.     * 
  32.     * @access   protected
  33.     * @return   mixed 
  34.     * @param    mixed   $value 
  35.     */
  36.     function decorate($value)
  37.     {
  38.         if (is_string($value)) {
  39.             return htmlSpecialchars($value, ENT_QUOTES, 
  40.                 $this->list->getEncoding());
  41.         } elseif (is_array($value)) {
  42.             return array_map(array(&$this, 'decorate'), $value);
  43.         }
  44.         return $value;
  45.     }
  46. }
  47. ?>

Documentation generated on Mon, 11 Mar 2019 13:56:36 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.