Automatically exported from code.google.com/p/planningalerts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

33 lines
676 B

  1. <?php
  2. /**
  3. * Smarty plugin
  4. * @package Smarty
  5. * @subpackage plugins
  6. */
  7. /**
  8. * Smarty strip_tags modifier plugin
  9. *
  10. * Type: modifier<br>
  11. * Name: strip_tags<br>
  12. * Purpose: strip html tags from text
  13. * @link http://smarty.php.net/manual/en/language.modifier.strip.tags.php
  14. * strip_tags (Smarty online manual)
  15. * @author Monte Ohrt <monte at ohrt dot com>
  16. * @param string
  17. * @param boolean
  18. * @return string
  19. */
  20. function smarty_modifier_strip_tags($string, $replace_with_space = true)
  21. {
  22. if ($replace_with_space)
  23. return preg_replace('!<[^>]*?>!', ' ', $string);
  24. else
  25. return strip_tags($string);
  26. }
  27. /* vim: set expandtab: */
  28. ?>