summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/helpers/security_helper.rst
diff options
context:
space:
mode:
authorEric Barnes <eric@ericlbarnes.com>2011-11-27 06:30:22 +0100
committerEric Barnes <eric@ericlbarnes.com>2011-11-27 06:30:22 +0100
commit7e66dda705743cbfe1d522ddb73e5694006ec42c (patch)
treec08b63deb28c09ec49d9173280f1ca234debfe50 /user_guide_src/source/helpers/security_helper.rst
parent7eceb03f083643254c7393c6b5ebe539e344a1ba (diff)
parente101593561a10632c1d63180436b19f1d7115046 (diff)
Merge branch 'refs/heads/develop' into feature/unit-tests
Conflicts: user_guide/helpers/number_helper.html
Diffstat (limited to 'user_guide_src/source/helpers/security_helper.rst')
-rw-r--r--user_guide_src/source/helpers/security_helper.rst67
1 files changed, 67 insertions, 0 deletions
diff --git a/user_guide_src/source/helpers/security_helper.rst b/user_guide_src/source/helpers/security_helper.rst
new file mode 100644
index 000000000..01018c61a
--- /dev/null
+++ b/user_guide_src/source/helpers/security_helper.rst
@@ -0,0 +1,67 @@
+###############
+Security Helper
+###############
+
+The Security Helper file contains security related functions.
+
+.. contents:: Page Contents
+
+Loading this Helper
+===================
+
+This helper is loaded using the following code
+
+::
+
+ $this->load->helper('security');
+
+The following functions are available:
+
+xss_clean()
+===========
+
+Provides Cross Site Script Hack filtering. This function is an alias to
+the one in the :doc:`Input class <../libraries/input>`. More info can
+be found there.
+
+sanitize_filename()
+===================
+
+Provides protection against directory traversal. This function is an
+alias to the one in the :doc:`Security class <../libraries/security>`.
+More info can be found there.
+
+do_hash()
+=========
+
+Permits you to create SHA1 or MD5 one way hashes suitable for encrypting
+passwords. Will create SHA1 by default. Examples
+
+::
+
+ $str = do_hash($str); // SHA1
+ $str = do_hash($str, 'md5'); // MD5
+
+.. note:: This function was formerly named dohash(), which has been
+ deprecated in favor of `do_hash()`.
+
+strip_image_tags()
+==================
+
+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()
+=================
+
+This is a security function that converts PHP tags to entities. Note: If
+you use the XSS filtering function it does this automatically.
+
+::
+
+ $string = encode_php_tags($string);
+