trial: ne pas écrire import.json si décodage JSON échoué

This commit is contained in:
Mitsukarenai 2013-07-11 13:38:29 +02:00
parent 960ab022d7
commit edb75a5f4b

View file

@ -120,7 +120,7 @@ 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, '[]}'))
if(!empty($json_media_import) && !strpos($json_media_import, '[]}') && json_decode($json_media_import) !== null)
{
file_put_contents('./'. $foldername .'/import.json', $json_media_import);
}