Use local temporary directory for PasswordExposedChecker cache
This commit is contained in:
parent
f104817967
commit
d9209b9c7a
1 changed files with 9 additions and 3 deletions
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
namespace Friendica\Model;
|
namespace Friendica\Model;
|
||||||
|
|
||||||
use DivineOmega\PasswordExposed\PasswordStatus;
|
use DivineOmega\PasswordExposed;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Friendica\Core\Addon;
|
use Friendica\Core\Addon;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
@ -20,7 +20,6 @@ use Friendica\Util\Crypto;
|
||||||
use Friendica\Util\DateTimeFormat;
|
use Friendica\Util\DateTimeFormat;
|
||||||
use Friendica\Util\Network;
|
use Friendica\Util\Network;
|
||||||
use LightOpenID;
|
use LightOpenID;
|
||||||
use function password_exposed;
|
|
||||||
|
|
||||||
require_once 'boot.php';
|
require_once 'boot.php';
|
||||||
require_once 'include/dba.php';
|
require_once 'include/dba.php';
|
||||||
|
@ -280,7 +279,14 @@ class User
|
||||||
*/
|
*/
|
||||||
public static function isPasswordExposed($password)
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue