diff options
-rwxr-xr-x | scire/.lib/DB_functions.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/scire/.lib/DB_functions.php b/scire/.lib/DB_functions.php index b6b63ab..1278552 100755 --- a/scire/.lib/DB_functions.php +++ b/scire/.lib/DB_functions.php @@ -513,10 +513,12 @@ function scire_add_script($name, $desc, $location, $script_data, $log_location, } #Now add the tags. - foreach ($script_tags as $name => $value) { - $result = $db->insert('dyn_tags', array('scriptid' => $scriptid, 'tag' => $name, 'tag_value' => $value) ); - if (!$result) { - return $db->error; + if ($script_tags) { + foreach ($script_tags as $name => $value) { + $result = $db->insert('dyn_tags', array('scriptid' => $scriptid, 'tag' => $name, 'tag_value' => $value) ); + if (!$result) { + return $db->error; + } } } |