PageRenderTime 57ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/src/_includes/Smarty/plugins/modifier.strip_tags.php

https://bitbucket.org/dereckson/icedeck
PHP | 32 lines | 9 code | 4 blank | 19 comment | 1 complexity | 481144a581e2d56a2182add2e09c5641 MD5 | raw file
Possible License(s): GPL-2.0
  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. ?>