Mise à jour des librairies vendor

This commit is contained in:
Caribana
2018-05-01 14:43:32 +02:00
parent b67375ae8e
commit d776be73fc
5211 changed files with 59115 additions and 25863 deletions

View File

@@ -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;
}
}