diff options
author | Andrew <browner12@gmail.com> | 2014-02-11 09:55:48 +0100 |
---|---|---|
committer | Andrew <browner12@gmail.com> | 2014-02-11 09:55:48 +0100 |
commit | b6d8b962e44202a74c9b9321a4a53f61a753fccf (patch) | |
tree | 2d3c533a55964a0d124f7cd6bb1d3d98c7b84056 /user_guide_src/source/helpers/security_helper.rst | |
parent | 41713aaa665189dd0a191c333c73c4a7b9f37c78 (diff) | |
parent | 29e12641a1bb952f493462db6757ae12c7da1f2c (diff) |
Merge branch 'develop' into patch-1
Conflicts:
system/libraries/Calendar.php
Diffstat (limited to 'user_guide_src/source/helpers/security_helper.rst')
-rw-r--r-- | user_guide_src/source/helpers/security_helper.rst | 106 |
1 files changed, 54 insertions, 52 deletions
diff --git a/user_guide_src/source/helpers/security_helper.rst b/user_guide_src/source/helpers/security_helper.rst index 21bf53490..2e26890b0 100644 --- a/user_guide_src/source/helpers/security_helper.rst +++ b/user_guide_src/source/helpers/security_helper.rst @@ -4,7 +4,12 @@ Security Helper The Security Helper file contains security related functions. -.. contents:: Page Contents +.. contents:: + :local: + +.. raw:: html + + <div class="custom-index container"></div> Loading this Helper =================== @@ -13,92 +18,89 @@ This helper is loaded using the following code:: $this->load->helper('security'); +Available Functions +=================== + The following functions are available: -xss_clean() -=========== -.. php:function:: xss_clean($str, $is_image = FALSE) +.. function:: xss_clean($str[, $is_image = FALSE]) :param string $str: Input data :param bool $is_image: Whether we're dealing with an image - :returns: string + :returns: XSS-clean string + :rtype: string -Provides Cross Site Script Hack filtering. + Provides Cross Site Script Hack filtering. -This function is an alias for ``CI_Input::xss_clean()``. For more info, -please see the :doc:`Input Library <../libraries/input>` documentation. + This function is an alias for ``CI_Input::xss_clean()``. For more info, + please see the :doc:`Input Library <../libraries/input>` documentation. -sanitize_filename() -=================== - -.. php:function:: sanitize_filename($filename) +.. function:: sanitize_filename($filename) :param string $filename: Filename - :returns: string + :returns: Sanitized file name + :rtype: string -Provides protection against directory traversal. + Provides protection against directory traversal. -This function is an alias for ``CI_Security::sanitize_filename()``. -For more info, please see the :doc:`Security Library <../libraries/security>` -documentation. + This function is an alias for ``CI_Security::sanitize_filename()``. + For more info, please see the :doc:`Security Library <../libraries/security>` + documentation. -do_hash() -========= -.. php:function:: do_hash($str, $type = 'sha1') +.. function:: do_hash($str[, $type = 'sha1']) :param string $str: Input :param string $type: Algorithm - :returns: string + :returns: Hex-formatted hash + :rtype: string -Permits you to create one way hashes suitable for encrypting -passwords. Will use SHA1 by default. + Permits you to create one way hashes suitable for encrypting + passwords. Will use SHA1 by default. -See `hash_algos() <http://php.net/function.hash_algos>`_ -for a full list of supported algorithms. + See `hash_algos() <http://php.net/function.hash_algos>`_ + for a full list of supported algorithms. -Examples:: + Examples:: - $str = do_hash($str); // SHA1 - $str = do_hash($str, 'md5'); // MD5 + $str = do_hash($str); // SHA1 + $str = do_hash($str, 'md5'); // MD5 -.. note:: This function was formerly named ``dohash()``, which has been - removed in favor of ``do_hash()``. + .. note:: This function was formerly named ``dohash()``, which has been + removed in favor of ``do_hash()``. -.. note:: This function is DEPRECATED. Use the native ``hash()`` instead. + .. note:: This function is DEPRECATED. Use the native ``hash()`` instead. -strip_image_tags() -================== -.. php:function:: strip_image_tags($str) +.. function:: strip_image_tags($str) - :param string $str: Input - :returns: string + :param string $str: Input string + :returns: The input string with no image tags + :rtype: string -This is a security function that will strip image tags from a string. -It leaves the image URL as plain text. + This is a security function that will strip image tags from a string. + It leaves the image URL as plain text. -Example:: + Example:: - $string = strip_image_tags($string); + $string = strip_image_tags($string); -This function is an alias for ``CI_Security::strip_image_tags()``. For -more info, please see the :doc:`Security Library <../libraries/security>` -documentation. + This function is an alias for ``CI_Security::strip_image_tags()``. For + more info, please see the :doc:`Security Library <../libraries/security>` + documentation. -encode_php_tags() -================= -.. php:function:: encode_php_tags($str) +.. function:: encode_php_tags($str) - :param string $str: Input - :returns: string + :param string $str: Input string + :returns: Safely formatted string + :rtype: string -This is a security function that converts PHP tags to entities. + This is a security function that converts PHP tags to entities. -.. note: :php:func:`xss_clean()` does this automatically, if you use it. + .. note:: :func:`xss_clean()` does this automatically, if you use it. -Example:: + Example:: - $string = encode_php_tags($string);
\ No newline at end of file + $string = encode_php_tags($string);
\ No newline at end of file |