PageRenderTime 49ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/library/Digitalus/Filter/StripSlashes.php

http://digitalus-cms.googlecode.com/
PHP | 56 lines | 13 code | 2 blank | 41 comment | 2 complexity | b5c253e322a1e7653649ea2c90f8940d MD5 | raw file
Possible License(s): GPL-3.0, BSD-3-Clause, LGPL-2.1
  1. <?php
  2. /**
  3. * Digitalus CMS
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://digitalus-media.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to info@digitalus-media.com so we can send you a copy immediately.
  14. *
  15. * @author LowTower - lowtower@gmx.de
  16. * @copyright Copyright (c) 2007 - 2010, Digitalus Media USA (digitalus-media.com)
  17. * @license http://digitalus-media.com/license/new-bsd New BSD License
  18. * @category Digitalus CMS
  19. * @package Digitalus
  20. * @subpackage Digitalus_Filter
  21. * @version $Id: StripSlashes.php 767 2010-05-04 19:22:01Z lowtower@gmx.de $
  22. * @link http://www.digitaluscms.com
  23. * @since Release 1.9.0
  24. */
  25. /**
  26. * @see Zend_Filter_Interface
  27. */
  28. require_once 'Zend/Filter/Interface.php';
  29. /**
  30. * Magic Quotes Filter
  31. *
  32. * @author LowTower - lowtower@gmx.de
  33. * @copyright Copyright (c) 2007 - 2010, Digitalus Media USA (digitalus-media.com)
  34. * @license http://digitalus-media.com/license/new-bsd New BSD License
  35. * @version Release: @package_version@
  36. * @link http://www.digitaluscms.com
  37. * @since Release 1.9.0
  38. */
  39. class Digitalus_Filter_StripSlashes implements Zend_Filter_Interface
  40. {
  41. /**
  42. * Value to strip tags from
  43. *
  44. * @param string $value
  45. */
  46. public function filter($value)
  47. {
  48. if (get_magic_quotes_gpc()) {
  49. return stripslashes($value);
  50. } else {
  51. return $value;
  52. }
  53. }
  54. }