fix: Check if the taxonomy directory contains the machinetag.json file before trying to read it, fixes MISP/misp-taxonomies#45

pull/1637/head
Iglocska 2016-10-28 13:11:28 +02:00
parent f87747ace2
commit 8e80bb47ff
1 changed files with 3 additions and 0 deletions

View File

@ -43,6 +43,9 @@ class Taxonomy extends AppModel {
}
$updated = array();
foreach ($directories as $dir) {
if (!file_exists(APP . 'files' . DS . 'taxonomies' . DS . $dir . DS . 'machinetag.json')) {
continue;
}
$file = new File(APP . 'files' . DS . 'taxonomies' . DS . $dir . DS . 'machinetag.json');
$vocab = json_decode($file->read(), true);
$file->close();