fix strpos looking at the wrong variable

This commit is contained in:
2023-02-28 12:17:58 +10:00
parent 3f0ebca4da
commit 95c5ed6a32

View File

@@ -7,7 +7,7 @@ if (isset($_GET['url'])) {
$filepath = realpath($_GET['url']); $filepath = realpath($_GET['url']);
} }
if ($filepath !== false && strlen($filepath) > 0 && strpos($filepath, 'uploads/') === 0 && is_file($filepath)) { if ($filepath !== false && strlen($filepath) > 0 && strpos($_GET['url'], 'uploads/') === 0 && is_file($filepath)) {
$image = imagecreatefromstring(file_get_contents($filepath)); $image = imagecreatefromstring(file_get_contents($filepath));
$newWidth = (isset($_GET['w']) ? intval($_GET['w']) : -1); $newWidth = (isset($_GET['w']) ? intval($_GET['w']) : -1);