From d9209b9c7a280eedce8f4b926366878656ab6f5b Mon Sep 17 00:00:00 2001 From: Benjamin Lorteau Date: Fri, 19 Oct 2018 11:26:48 -0400 Subject: [PATCH 1/2] Use local temporary directory for PasswordExposedChecker cache --- src/Model/User.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Model/User.php b/src/Model/User.php index 17c9831ca9..63aaa1e3de 100644 --- a/src/Model/User.php +++ b/src/Model/User.php @@ -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; } /** From 7795643134a7cb5ea5522469d6c130925ebc5b99 Mon Sep 17 00:00:00 2001 From: Benjamin Lorteau Date: Fri, 19 Oct 2018 11:27:11 -0400 Subject: [PATCH 2/2] Add system.temppath description to config/settings.ini.php --- config/settings.ini.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/settings.ini.php b/config/settings.ini.php index 353b1fa1f4..02482c8af8 100644 --- a/config/settings.ini.php +++ b/config/settings.ini.php @@ -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