From 1d0f6479da4cdbd14b747ead6cb934a769a9579d Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 28 Oct 2010 02:27:09 +0000 Subject: - Patch #839556 by jrchamp, dmitrig01: remove pointless usage of array_key_exists(). --- modules/system/image.gd.inc | 2 +- modules/system/system.api.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/system') diff --git a/modules/system/image.gd.inc b/modules/system/image.gd.inc index 2f7a89fce..b10595f47 100644 --- a/modules/system/image.gd.inc +++ b/modules/system/image.gd.inc @@ -351,7 +351,7 @@ function image_gd_get_info(stdClass $image) { if (isset($data) && is_array($data)) { $extensions = array('1' => 'gif', '2' => 'jpg', '3' => 'png'); - $extension = array_key_exists($data[2], $extensions) ? $extensions[$data[2]] : ''; + $extension = isset($extensions[$data[2]]) ? $extensions[$data[2]] : ''; $details = array( 'width' => $data[0], 'height' => $data[1], diff --git a/modules/system/system.api.php b/modules/system/system.api.php index 262f53757..11780eec7 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -2645,7 +2645,7 @@ function hook_file_url_alter(&$uri) { // Serve files with one of the CDN extensions from CDN 1, all others from // CDN 2. $pathinfo = pathinfo($path); - if (array_key_exists('extension', $pathinfo) && in_array($pathinfo['extension'], $cdn_extensions)) { + if (isset($pathinfo['extension']) && in_array($pathinfo['extension'], $cdn_extensions)) { $uri = $cdn1 . '/' . $path; } else { -- cgit v1.2.3