Only overwrite URL if it is similar

This commit is contained in:
Jay Trees 2022-02-23 15:40:56 +01:00
parent 2861e4111d
commit 716eb99254

View file

@ -20,7 +20,7 @@ switch ($_SERVER['REQUEST_METHOD']) {
$cache = new EmbedCache($_GET['url']);
$info = $cache->get(true);
if ($info->url) {
if ($info->url && str_contains($_GET['url'], $info->url)) {
$database->query('UPDATE `products`
SET `url` = "' . $info->url . '"
WHERE `id` = ' . $_GET['product_id'] . '