From 8719a5c7fe75b84f49f584065e5ef4e4e2a0f16f Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 8 Oct 2009 16:42:59 +0000 Subject: Deprecated the dohash() function in favour of do_hash() for naming consistency. --- system/helpers/security_helper.php | 20 ++++++++++++++++++-- user_guide/changelog.html | 1 + user_guide/helpers/security_helper.html | 7 ++++--- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/system/helpers/security_helper.php b/system/helpers/security_helper.php index 9cc70aaff..8fb53e718 100644 --- a/system/helpers/security_helper.php +++ b/system/helpers/security_helper.php @@ -46,6 +46,22 @@ if ( ! function_exists('xss_clean')) // -------------------------------------------------------------------- +/** + * Hash encode a string + * + * This is simply an alias for do_hash() + * dohash() is now deprecated + */ +if ( ! function_exists('dohash')) +{ + function dohash($str, $type = 'sha1') + { + return $this->do_hash($str, $type); + } +} + +// -------------------------------------------------------------------- + /** * Hash encode a string * @@ -53,9 +69,9 @@ if ( ! function_exists('xss_clean')) * @param string * @return string */ -if ( ! function_exists('dohash')) +if ( ! function_exists('do_hash')) { - function dohash($str, $type = 'sha1') + function do_hash($str, $type = 'sha1') { if ($type == 'sha1') { diff --git a/user_guide/changelog.html b/user_guide/changelog.html index a941904ce..e61961b39 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -70,6 +70,7 @@ SVN Revision:

  • Helpers
  • diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html index 5732cb7db..dfc813c66 100644 --- a/user_guide/helpers/security_helper.html +++ b/user_guide/helpers/security_helper.html @@ -75,16 +75,17 @@ Security Helper Input class. More info can be found there.

    -

    dohash()

    +

    do_hash()

    Permits you to create SHA1 or MD5 one way hashes suitable for encrypting passwords. Will create SHA1 by default. Examples:

    -$str = dohash($str); // SHA1
    +$str = do_hash($str); // SHA1

    -$str = dohash($str, 'md5'); // MD5 +$str = do_hash($str, 'md5'); // MD5
    +

    Note: This function was formerly named dohash(), which has been deprecated in favour of do_hash().

    -- cgit v1.2.3-24-g4f1b