aboutsummaryrefslogtreecommitdiff
path: root/pmwiki.php
diff options
context:
space:
mode:
authorpetko <petko@524c5546-5005-0410-9a3e-e25e191bd360>2023-05-09 07:15:19 +0000
committerpetko <petko@524c5546-5005-0410-9a3e-e25e191bd360>2023-05-09 07:15:19 +0000
commit4c5f94f6486aca7be926f959f6e5f81a6a22052e (patch)
tree290ec118cc3c08f3e4da1e7149ca448155135f9f /pmwiki.php
parentf58520168d136e8a615ffae59ad0641de936026d (diff)
downloadpmwiki.svn-4c5f94f6486aca7be926f959f6e5f81a6a22052e.tar.bz2
Fix password_verify() logic, retry with crypt() on failure.
git-svn-id: svn://pmwiki.org/pmwiki/trunk@4465 524c5546-5005-0410-9a3e-e25e191bd360
Diffstat (limited to 'pmwiki.php')
-rw-r--r--pmwiki.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/pmwiki.php b/pmwiki.php
index c2a33ef8..2a2c8872 100644
--- a/pmwiki.php
+++ b/pmwiki.php
@@ -855,8 +855,10 @@ function pmcrypt($str, $salt=null) {
SDV($PmCryptAlgo, PASSWORD_DEFAULT);
if ($salt && preg_match('/^(-?@|\\*$)/', $salt)) return false;
if (!is_null($salt)) {
-// if(function_exists('password_verify'))
-// return password_verify($str, $salt);
+ if(function_exists('password_verify')) {
+ if(password_verify($str, $salt)) return $salt;
+ # else retry with crypt()
+ }
return crypt($str, $salt);
}