mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-05-10 15:12:12 +00:00
Fix TypeError in LCSCProvider when keyword is numeric string
PHP auto-casts numeric string array keys to int. When a search keyword is a pure number (e.g., a part number like "12345"), the foreach loop passes an int to processSearchResponse() which expects string. Cast keyword to string explicitly.
This commit is contained in:
parent
e70aa0ea19
commit
8e66f32ddc
1 changed files with 1 additions and 0 deletions
|
|
@ -396,6 +396,7 @@ class LCSCProvider implements BatchInfoProviderInterface, URLHandlerInfoProvider
|
|||
// Now collect all results (like .then() in JavaScript)
|
||||
foreach ($responses as $keyword => $response) {
|
||||
try {
|
||||
$keyword = (string) $keyword;
|
||||
$arr = $response->toArray(); // This waits for the response
|
||||
$results[$keyword] = $this->processSearchResponse($arr, $keyword);
|
||||
} catch (\Exception $e) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue