mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-28 13:58:31 +02:00
Allow slashes in digikey product ids
This commit is contained in:
parent
2be76a488f
commit
52c6884e28
3 changed files with 11 additions and 4 deletions
|
@ -73,7 +73,10 @@ final class PartInfoRetriever
|
|||
*/
|
||||
protected function searchInProvider(InfoProviderInterface $provider, string $keyword): array
|
||||
{
|
||||
return $this->partInfoCache->get("search_{$provider->getProviderKey()}_{$keyword}", function (ItemInterface $item) use ($provider, $keyword) {
|
||||
//Generate key and escape reserved characters from the provider id
|
||||
$escaped_keyword = urlencode($keyword);
|
||||
|
||||
return $this->partInfoCache->get("search_{$provider->getProviderKey()}_{$escaped_keyword}", function (ItemInterface $item) use ($provider, $keyword) {
|
||||
//Set the expiration time
|
||||
$item->expiresAfter(self::CACHE_RESULT_EXPIRATION);
|
||||
|
||||
|
@ -92,7 +95,11 @@ final class PartInfoRetriever
|
|||
{
|
||||
$provider = $this->provider_registry->getProviderByKey($provider_key);
|
||||
|
||||
return $this->partInfoCache->get("details_{$provider_key}_{$part_id}", function (ItemInterface $item) use ($provider, $part_id) {
|
||||
//Generate key and escape reserved characters from the provider id
|
||||
$escaped_part_id = urlencode($part_id);
|
||||
|
||||
|
||||
return $this->partInfoCache->get("details_{$provider_key}_{$escaped_part_id}", function (ItemInterface $item) use ($provider, $part_id) {
|
||||
//Set the expiration time
|
||||
$item->expiresAfter(self::CACHE_DETAIL_EXPIRATION);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue