1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 13:47:31 +02:00

Fix for "Warning Invalid argument supplied for foreach()".

This commit is contained in:
lonalore
2017-02-02 09:34:20 +01:00
parent cdc23fb2d7
commit 2a6c01f58c

View File

@@ -1633,12 +1633,15 @@ class media_admin_ui extends e_admin_ui
$accData = json_decode($accData,true);
$channelID = e107::pref('core', 'youtube_default_account');
foreach($accData['items'] as $val)
if(!empty($accData['items']))
{
if($val['kind'] == 'youtube#channel')
foreach($accData['items'] as $val)
{
if($val['kind'] == 'youtube#channel')
{
$channelID = $val['id'];
break;
}
}
}