From b8c283a695c8074a57d8c3dfa00934312638931d Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 19 Jul 2013 16:02:53 -0700 Subject: Dropping unecessary php: directive to function definitions in user guide --- user_guide_src/source/helpers/security_helper.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'user_guide_src/source/helpers/security_helper.rst') diff --git a/user_guide_src/source/helpers/security_helper.rst b/user_guide_src/source/helpers/security_helper.rst index 21bf53490..b06f78df6 100644 --- a/user_guide_src/source/helpers/security_helper.rst +++ b/user_guide_src/source/helpers/security_helper.rst @@ -18,7 +18,7 @@ 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 @@ -32,7 +32,7 @@ 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 @@ -46,7 +46,7 @@ documentation. do_hash() ========= -.. php:function:: do_hash($str, $type = 'sha1') +.. function:: do_hash($str, $type = 'sha1') :param string $str: Input :param string $type: Algorithm @@ -71,7 +71,7 @@ Examples:: strip_image_tags() ================== -.. php:function:: strip_image_tags($str) +.. function:: strip_image_tags($str) :param string $str: Input :returns: string @@ -90,7 +90,7 @@ documentation. encode_php_tags() ================= -.. php:function:: encode_php_tags($str) +.. function:: encode_php_tags($str) :param string $str: Input :returns: string -- cgit v1.2.3-24-g4f1b From 123bb20c52e0e9d6a622e14bac33e05b10ffc013 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 19 Jul 2013 16:37:51 -0700 Subject: Updating user guide :php:func: refs to :func: --- user_guide_src/source/helpers/security_helper.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide_src/source/helpers/security_helper.rst') diff --git a/user_guide_src/source/helpers/security_helper.rst b/user_guide_src/source/helpers/security_helper.rst index b06f78df6..cf9854c1b 100644 --- a/user_guide_src/source/helpers/security_helper.rst +++ b/user_guide_src/source/helpers/security_helper.rst @@ -97,7 +97,7 @@ encode_php_tags() 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:: -- cgit v1.2.3-24-g4f1b From f9491c984d56a9fb363f572bd4c10a185e5f186b Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 19 Jul 2013 16:46:18 -0700 Subject: Update Security helper docs --- user_guide_src/source/helpers/security_helper.rst | 80 +++++++++++------------ 1 file changed, 39 insertions(+), 41 deletions(-) (limited to 'user_guide_src/source/helpers/security_helper.rst') diff --git a/user_guide_src/source/helpers/security_helper.rst b/user_guide_src/source/helpers/security_helper.rst index cf9854c1b..7df85d017 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 + +
Loading this Helper =================== @@ -13,92 +18,85 @@ This helper is loaded using the following code:: $this->load->helper('security'); +Available Functions +=================== + The following functions are available: -xss_clean() -=========== -.. 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 -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() -=================== .. function:: sanitize_filename($filename) :param string $filename: Filename :returns: 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() -========= -.. function:: do_hash($str, $type = 'sha1') +.. function:: do_hash($str[, $type = 'sha1']) :param string $str: Input :param string $type: Algorithm :returns: 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() `_ -for a full list of supported algorithms. + See `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() -================== .. function:: strip_image_tags($str) :param string $str: Input :returns: 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() -================= .. function:: encode_php_tags($str) :param string $str: Input :returns: string -This is a security function that converts PHP tags to entities. + This is a security function that converts PHP tags to entities. -.. note: :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 -- cgit v1.2.3-24-g4f1b From 3de130c2da3b93a3404f264e92d7b65354de3548 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 7 Feb 2014 23:31:49 +0200 Subject: [ci skip] Add return types to helper docs (+ some other formatting) --- user_guide_src/source/helpers/security_helper.rst | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'user_guide_src/source/helpers/security_helper.rst') diff --git a/user_guide_src/source/helpers/security_helper.rst b/user_guide_src/source/helpers/security_helper.rst index 7df85d017..2e26890b0 100644 --- a/user_guide_src/source/helpers/security_helper.rst +++ b/user_guide_src/source/helpers/security_helper.rst @@ -28,18 +28,19 @@ The following functions are available: :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. This function is an alias for ``CI_Input::xss_clean()``. For more info, please see the :doc:`Input Library <../libraries/input>` documentation. - .. function:: sanitize_filename($filename) :param string $filename: Filename - :returns: string + :returns: Sanitized file name + :rtype: string Provides protection against directory traversal. @@ -52,7 +53,8 @@ The following functions are available: :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. @@ -73,8 +75,9 @@ The following functions are available: .. 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. @@ -90,8 +93,9 @@ The following functions are available: .. 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. -- cgit v1.2.3-24-g4f1b