mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-02-13 21:19:36 +00:00
Refactor ID extraction logic in BuerklinProvider
This commit is contained in:
parent
46c2fe3aad
commit
5f65176636
1 changed files with 6 additions and 3 deletions
|
|
@ -661,10 +661,13 @@ class BuerklinProvider implements BatchInfoProviderInterface, URLHandlerInfoProv
|
|||
if (strpos($path, '/p/') === false) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Reject "/.../p" and "/.../p/" (no actual ID)
|
||||
if ($id === 'p' || $id === '') {
|
||||
return null;
|
||||
}
|
||||
|
||||
$id = basename(rtrim($path, '/'));
|
||||
|
||||
return $id !== '' ? $id : null;
|
||||
return $id;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue