This is documentation for Kohana v2.3.x.

Table of Contents
StatusDraft
TodoProof read

Security Helper

The security helper offers various methods that assist with input filtering.

Methods

xss_clean()

'xss_clean' behaves the same as xss_clean in the Input library.

strip_image_tags()

'strip_image_tags()' strips the image tags out of a string and returns the string trimmed without the image tags.

$string = '<b>Check this image:</b> <img src="http://www.example.com/example.jpg" />';
print Kohana::debug(security::strip_image_tags($string));

It will result in HTML as:

<b>Check this image:</b> http://www.example.com/example.jpg

encode_php_tags()

'encode_php_tags' replaces PHP tags in a string with their corresponding HTML entities.

$string = '<?php echo "<b>Hello World!</b>" ?>';
print Kohana::debug(security::encode_php_tags($string));

It will result in HTML as:

&lt;?php echo "<b>Hello World!</b>" ?&gt;