Security Helper

The Security Helper file contains security related functions.

Loading this Helper

This helper is loaded using the following code:

helper('security');

Available Functions

The following functions are available:

sanitize_filename($filename)
パラメータ:
  • $filename (string) -- Filename
戻り値:

Sanitized file name

戻り値の型:

string

Provides protection against directory traversal.

This function is an alias for \CodeIgniter\Security::sanitize_filename(). For more info, please see the Security Library documentation.

strip_image_tags($str)
パラメータ:
  • $str (string) -- Input string
戻り値:

The input string with no image tags

戻り値の型:

string

This is a security function that will strip image tags from a string. It leaves the image URL as plain text.

例:

$string = strip_image_tags($string);
encode_php_tags($str)
パラメータ:
  • $str (string) -- Input string
戻り値:

Safely formatted string

戻り値の型:

string

This is a security function that converts PHP tags to entities.

例:

$string = encode_php_tags($string);