diff options
author | johncongdon <john@johncongdon.com> | 2013-05-09 19:01:28 -0600 |
---|---|---|
committer | johncongdon <john@johncongdon.com> | 2013-05-09 19:01:28 -0600 |
commit | 04b9a755749f0cc202d1eb5d51d0d5082b0c6cf2 (patch) | |
tree | 093425b7ed7f96d341577a5b6ee163313f1e556d | |
parent | 432ce5617c34c6e5d89a99efe5107ff5b1dcac26 (diff) | |
download | password_compat-04b9a755749f0cc202d1eb5d51d0d5082b0c6cf2.zip password_compat-04b9a755749f0cc202d1eb5d51d0d5082b0c6cf2.tar.gz password_compat-04b9a755749f0cc202d1eb5d51d0d5082b0c6cf2.tar.bz2 |
Rely on checking for PASSWORD_DEFAULT, which should ALWAYS be available.
Since this is supposed to be forward compatible. What happens if BCRYPT is pulled one day for any reason? This would break forward compatibility, but relying on PASSWORD_DEFAULT should be safe.
I think another option would be:
if ( ! function_exists('password_hash') ) {
}
-rw-r--r-- | lib/password.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/password.php b/lib/password.php index 4d0e8b7..faa5eaa 100644 --- a/lib/password.php +++ b/lib/password.php @@ -7,7 +7,7 @@ * @copyright 2012 The Authors */ -if (!defined('PASSWORD_BCRYPT')) { +if (!defined('PASSWORD_DEFAULT')) { define('PASSWORD_BCRYPT', 1); define('PASSWORD_DEFAULT', PASSWORD_BCRYPT); |