From 2a236aeaaf8b5d1e1536c0d05cf1f31de8ee2ef2 Mon Sep 17 00:00:00 2001 From: Michael-Labriola Date: Sat, 7 Jan 2023 13:10:56 -0500 Subject: [PATCH 1/2] Update class_image.php "each" removed in PHP8 --- kcfinder/lib/class_image.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kcfinder/lib/class_image.php b/kcfinder/lib/class_image.php index 49056529c..296f479e0 100644 --- a/kcfinder/lib/class_image.php +++ b/kcfinder/lib/class_image.php @@ -116,8 +116,8 @@ final protected function buildImage($image) { $img = $image->image; } elseif (is_array($image)) { - list($key, $width) = each($image); - list($key, $height) = each($image); + $width = $image[0]; + $height = $image[1]; $img = $this->getBlankImage($width, $height); } else @@ -240,4 +240,4 @@ abstract protected function getImage($image, &$width, &$height); } -?> \ No newline at end of file +?> From 0912d74b891fc23ce7698813689e5196d2f6e96e Mon Sep 17 00:00:00 2001 From: Michael-Labriola Date: Sat, 7 Jan 2023 20:48:13 -0500 Subject: [PATCH 2/2] Update class_image.php --- kcfinder/lib/class_image.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kcfinder/lib/class_image.php b/kcfinder/lib/class_image.php index 296f479e0..1bb7d924f 100644 --- a/kcfinder/lib/class_image.php +++ b/kcfinder/lib/class_image.php @@ -116,8 +116,8 @@ final protected function buildImage($image) { $img = $image->image; } elseif (is_array($image)) { - $width = $image[0]; - $height = $image[1]; + $width = array_shift($image); + $height = array_shift($image); $img = $this->getBlankImage($width, $height); } else