From 32817b41336940784558771ed55f893c5e11ff57 Mon Sep 17 00:00:00 2001 From: Mateusz Uzdowski Date: Thu, 24 May 2012 16:04:41 +1200 Subject: [PATCH] BUGFIX: replace foreach loop with a core function call --- oembed/Oembed.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/oembed/Oembed.php b/oembed/Oembed.php index 4c40cfea0..58ed1d23f 100644 --- a/oembed/Oembed.php +++ b/oembed/Oembed.php @@ -224,10 +224,11 @@ class Oembed_Result extends ViewableData { if(!$data) { $data = array(); } - foreach($data as $k=>$v) { - unset($data[$k]); - $data[strtolower($k)] = $v; - } + + // Convert all keys to lowercase + $data = array_change_key_case($data, CASE_LOWER); + + // Purge everything if the type does not match. if($this->type && $this->type != $data['type']) { $data = array(); }