#37 slightly improved

This commit is contained in:
ArthurHoaro 2013-07-19 12:39:35 +02:00
parent 7d7e1c90a9
commit 7be56daca7

View file

@ -120,7 +120,10 @@ function xsafimport($xsafremote, $max_exec_time) {
$json_media_import = file_get_contents($remote_media);
if(DEBUG)
debug($json_media_import);
if(!empty($json_media_import) && !strpos($json_media_import, '[]}') && json_decode($json_media_import) !== null)
$media_data = json_decode($json_media_import, true);
if(DEBUG)
debug($media_data);
if(!empty($json_media_import) && $media_data !== null && !empty($media_data['files']))
{
file_put_contents('./'. $foldername .'/import.json', $json_media_import);
}