From 777b153d3b10b9f273397de4c6d73baf013860de Mon Sep 17 00:00:00 2001
From: "yogeshwar.g" <yogeshwar.g@vtigersolutions.com>
Date: Fri, 12 Jan 2024 12:22:04 +0530
Subject: [PATCH] #Fixes::157000819::yogeshwar::Changes Removed

---
 kcfinder/lib/class_gd.php | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/kcfinder/lib/class_gd.php b/kcfinder/lib/class_gd.php
index 0ac2aaea9..adfc89784 100644
--- a/kcfinder/lib/class_gd.php
+++ b/kcfinder/lib/class_gd.php
@@ -52,13 +52,8 @@ class gd {
             $height = @imagesy($image);
 
         } elseif (is_array($image)) {
-            $key = key($image);
-            $width = current($image);
-            next($image);
-
-            $key = key($image);
-            $height = current($image);
-            next($image);
+            list($key, $width) = each($image);
+            list($key, $height) = each($image);
             $image = imagecreatetruecolor($width, $height);
 
         } elseif (false !== (list($width, $height, $type) = @getimagesize($image))) {
@@ -76,8 +71,8 @@ class gd {
         }
 
         $return = (
-            ((is_resource($image) && get_resource_type($image) === 'gd') ||
-            (is_object($image) && $image instanceof \GDImage)) &&
+            is_resource($image) &&
+            (get_resource_type($image) == "gd") &&
             isset($width) &&
             isset($height) &&
             (preg_match('/^[1-9][0-9]*$/', $width) !== false) &&
-- 
GitLab