Mise à jour des librairies vendor
This commit is contained in:
15
vendor/google/auth/src/CacheTrait.php
vendored
15
vendor/google/auth/src/CacheTrait.php
vendored
@@ -19,6 +19,8 @@ namespace Google\Auth;
|
||||
|
||||
trait CacheTrait
|
||||
{
|
||||
private $maxKeyLength = 64;
|
||||
|
||||
/**
|
||||
* Gets the cached value if it is present in the cache when that is
|
||||
* available.
|
||||
@@ -35,7 +37,9 @@ trait CacheTrait
|
||||
}
|
||||
|
||||
$cacheItem = $this->cache->getItem($key);
|
||||
return $cacheItem->get();
|
||||
if ($cacheItem->isHit()) {
|
||||
return $cacheItem->get();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,6 +71,13 @@ trait CacheTrait
|
||||
$key = $this->cacheConfig['prefix'] . $key;
|
||||
|
||||
// ensure we do not have illegal characters
|
||||
return preg_replace('|[^a-zA-Z0-9_\.!]|', '', $key);
|
||||
$key = preg_replace('|[^a-zA-Z0-9_\.!]|', '', $key);
|
||||
|
||||
// Hash keys if they exceed $maxKeyLength (defaults to 64)
|
||||
if ($this->maxKeyLength && strlen($key) > $this->maxKeyLength) {
|
||||
$key = substr(hash('sha256', $key), 0, $this->maxKeyLength);
|
||||
}
|
||||
|
||||
return $key;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user