summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Barth2010-09-08 16:04:02 (GMT)
committer Alex Barth2010-09-08 16:04:02 (GMT)
commit395a6245ccab56d0b029025cc03963a770958194 (patch)
tree9251b1e973c07d610c665c63eddc2dbe50407791
parentb00eed6c13986f492ee768c17e24cb22f553286a (diff)
Check term before inserting it, may be not numeric.
-rw-r--r--data_taxonomy/data_taxonomy.module6
1 files changed, 4 insertions, 2 deletions
diff --git a/data_taxonomy/data_taxonomy.module b/data_taxonomy/data_taxonomy.module
index ec754cf..644cf40 100644
--- a/data_taxonomy/data_taxonomy.module
+++ b/data_taxonomy/data_taxonomy.module
@@ -117,8 +117,10 @@ function data_taxonomy_data_update($record, $table_name) {
* The numeric vid identifier of a vocabulary.
*/
function _data_taxonomy_save_terms($table_name, $id, $terms, $vid) {
- foreach ($terms as $tid) {
- db_query("INSERT INTO {data_taxonomy}(id, data_table_name, tid) VALUES(%d, '%s', %d)", $id, $table_name, $tid);
+ foreach ($terms as $term) {
+ if (is_numeric($term)) {
+ db_query("INSERT INTO {data_taxonomy}(id, data_table_name, tid) VALUES(%d, '%s', %d)", $id, $table_name, $term);
+ }
}
}