Update security.php

This commit is contained in:
Namhyeon Go 2018-09-26 20:17:19 +09:00 committed by GitHub
parent af8f9e7d2f
commit c4754c2589
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -177,6 +177,14 @@ if(!function_exists("get_hashed_text")) {
function get_hashed_text($text, $algo="sha1", $options=array()) {
$hashed_text = false;
if(!array_key_empty("salt", $options)) {
if($options['salt'] == true) {
$text .= get_salt();
} elseif(is_string($options['salt']) && $strlen($options['salt']) > 0) {
$text . = $options['salt'];
}
}
switch($algo) {
case "sha1":
$hashed_text = sha1($text);