1 <?php defined('SYSPATH') OR die('No direct access allowed.');
3 * Security helper class.
5 * $Id: security.php 3769 2008-12-15 00:48:56Z zombor $
9 * @copyright (c) 2007-2008 Kohana Team
10 * @license http://kohanaphp.com/license.html
15 * Sanitize a string with the xss_clean method.
17 * @param string string to sanitize
20 public static function xss_clean($str)
22 return Input::instance()->xss_clean($str);
26 * Remove image tags from a string.
28 * @param string string to sanitize
31 public static function strip_image_tags($str)
33 return preg_replace('#<img\s.*?(?:src\s*=\s*["\']?([^"\'<>\s]*)["\']?[^>]*)?>#is', '$1', $str);
37 * Remove PHP tags from a string.
39 * @param string string to sanitize
42 public static function encode_php_tags($str)
44 return str_replace(array('<?', '?>'), array('<?', '?>'), $str);