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,6 +1633,8 @@ class media_admin_ui extends e_admin_ui
$accData = json_decode($accData,true); $accData = json_decode($accData,true);
$channelID = e107::pref('core', 'youtube_default_account'); $channelID = e107::pref('core', 'youtube_default_account');
if(!empty($accData['items']))
{
foreach($accData['items'] as $val) foreach($accData['items'] as $val)
{ {
if($val['kind'] == 'youtube#channel') if($val['kind'] == 'youtube#channel')
@@ -1641,6 +1643,7 @@ class media_admin_ui extends e_admin_ui
break; break;
} }
} }
}
$feed = "https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=".$channelID."&type=video&maxResults=20&key=".$apiKey; $feed = "https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=".$channelID."&type=video&maxResults=20&key=".$apiKey;
$extension = 'youtube'; $extension = 'youtube';