mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-02-20 00:33:45 +01:00
Add https:// if not existing
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user