Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/Repositories/ApiKeysRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,13 @@
// Key will be valid for 25 hours.
$validUntil = time() + (3600 * 25);

$replicas = config('scout-'.str_replace('_', '-', $searchableAs).'.replicas', []);
$restrictIndices = join(',', [$searchableAs, ...$replicas]);

Check warning on line 89 in src/Repositories/ApiKeysRepository.php

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/Repositories/ApiKeysRepository.php#L89

Potential SQL injection with direct variable usage in join with param #3

$securedSearchKey = $this->client::generateSecuredApiKey($searchKey, [
'restrictIndices' => $searchableAs,
'restrictIndices' => $restrictIndices,
'validUntil' => $validUntil,
]);

$this->cache->put(
self::SEARCH_KEY.'.'.$searchableAs, $securedSearchKey, DateInterval::createFromDateString('24 hours')
);
Expand Down