mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-02-11 12:09:36 +00:00
Add https:// if not existing
This commit is contained in:
parent
73dbe64a83
commit
52be548170
1 changed files with 8 additions and 0 deletions
|
|
@ -161,6 +161,14 @@ class GenericWebProvider implements InfoProviderInterface
|
|||
|
||||
public function getDetails(string $id): PartDetailDTO
|
||||
{
|
||||
//Add scheme if missing
|
||||
if (!preg_match('/^https?:\/\//', $id)) {
|
||||
//Remove any leading slashes
|
||||
$id = ltrim($id, '/');
|
||||
|
||||
$id = 'https://'.$id;
|
||||
}
|
||||
|
||||
$url = $id;
|
||||
|
||||
//Try to get the webpage content
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue