OSDN Git Service

Update sql.php
authorJoshua Thomas Przyborowski <joshua.przyborowski@gmail.com>
Thu, 14 Dec 2017 01:02:51 +0000 (19:02 -0600)
committerGitHub <noreply@github.com>
Thu, 14 Dec 2017 01:02:51 +0000 (19:02 -0600)
sql.php

diff --git a/sql.php b/sql.php
index c47fbbb..6c39a77 100644 (file)
--- a/sql.php
+++ b/sql.php
@@ -191,11 +191,14 @@ require_once($SettDir['misc'].'utf8.php');
 require_once($SettDir['inc'].'filename.php');
 if(!isset($Settings['use_hashtype'])) {
        $Settings['use_hashtype'] = "sha1"; }
-if(!function_exists('hash')||!function_exists('hash_algos')) {
+if(!function_exists('hash')||!function_exists('hash_algos')||!function_exists('password_hash')) {
 if($Settings['use_hashtype']!="md5"&&
    $Settings['use_hashtype']!="sha1") {
        $Settings['use_hashtype'] = "sha1"; } }
-if(function_exists('hash')&&function_exists('hash_algos')) {
+if(function_exists('hash')&&function_exists('hash_algos')&&$Settings['use_hashtype']!="bcrypt") {
+if(!in_array($Settings['use_hashtype'],hash_algos())) {
+       $Settings['use_hashtype'] = "sha1"; }
+if(function_exists('password_hash')&&$Settings['use_hashtype']=="bcrypt") {
 if(!in_array($Settings['use_hashtype'],hash_algos())) {
        $Settings['use_hashtype'] = "sha1"; }
 if($Settings['use_hashtype']!="md2"&&