]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #5971 from MrPetovan/bug/5970-use-temppath-passwordexposed
authorMichael Vogel <icarus@dabo.de>
Fri, 19 Oct 2018 17:00:00 +0000 (19:00 +0200)
committerGitHub <noreply@github.com>
Fri, 19 Oct 2018 17:00:00 +0000 (19:00 +0200)
Use system.temppath for PasswordExposedChecker cache

config/settings.ini.php
src/Model/User.php

index 353b1fa1f444a25d83ac31f95a09b0aa150ee310..02482c8af8931fc81a112bbd13273d3b6e43c366 100644 (file)
@@ -92,6 +92,10 @@ optimize_max_tablesize = -1
 ; Set to 0 to disable, 2 to enable, 1 is deprecated but wont need mcrypt.
 rino_encrypt = 2
 
+; temppath (String)
+; Custom temporary file directory
+temppath =
+
 ; theme (String)
 ; System theme name.
 theme = vier
index 17c9831ca92530b5d8c9bdd1673094dbf518d6a8..63aaa1e3de2c59312e1033bbd2ad6d5807e44210 100644 (file)
@@ -5,7 +5,7 @@
  */
 namespace Friendica\Model;
 
-use DivineOmega\PasswordExposed\PasswordStatus;
+use DivineOmega\PasswordExposed;
 use Exception;
 use Friendica\Core\Addon;
 use Friendica\Core\Config;
@@ -20,7 +20,6 @@ use Friendica\Util\Crypto;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Network;
 use LightOpenID;
-use function password_exposed;
 
 require_once 'boot.php';
 require_once 'include/dba.php';
@@ -280,7 +279,14 @@ class User
         */
        public static function isPasswordExposed($password)
        {
-               return password_exposed($password) === PasswordStatus::EXPOSED;
+               $cache = new \DivineOmega\DOFileCachePSR6\CacheItemPool();
+               $cache->changeConfig([
+                       'cacheDirectory' => get_temppath() . '/password-exposed-cache/',
+               ]);
+
+               $PasswordExposedCHecker = new PasswordExposed\PasswordExposedChecker(null, $cache);
+
+               return $PasswordExposedCHecker->passwordExposed($password) === PasswordExposed\PasswordStatus::EXPOSED;
        }
 
        /**