diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/forum.module | 2 | ||||
-rw-r--r-- | modules/forum/forum.module | 2 | ||||
-rw-r--r-- | modules/taxonomy.module | 8 | ||||
-rw-r--r-- | modules/taxonomy/taxonomy.module | 8 |
4 files changed, 16 insertions, 4 deletions
diff --git a/modules/forum.module b/modules/forum.module index 456b17d92..983c655a9 100644 --- a/modules/forum.module +++ b/modules/forum.module @@ -259,7 +259,7 @@ function _forum_get_vid() { // Check to see if a forum vocabulary exists $vid = db_result(db_query("SELECT vid FROM {vocabulary} WHERE module='%s'", 'forum')); if (!$vid) { - $vocabulary = taxonomy_save_vocabulary(array('name' => 'Forums', 'multiple' => '0', 'required' => '1', 'hierarchy' => '1', 'relations' => '0', 'module' => 'forum', 'nodes' => array('forum'))); + $vocabulary = taxonomy_save_vocabulary(array('name' => 'Forums', 'multiple' => 0, 'required' => 1, 'hierarchy' => 1, 'relations' => 0, 'module' => 'forum', 'nodes' => array('forum'))); $vid = $vocabulary['vid']; } variable_set('forum_nav_vocabulary', $vid); diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 456b17d92..983c655a9 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -259,7 +259,7 @@ function _forum_get_vid() { // Check to see if a forum vocabulary exists $vid = db_result(db_query("SELECT vid FROM {vocabulary} WHERE module='%s'", 'forum')); if (!$vid) { - $vocabulary = taxonomy_save_vocabulary(array('name' => 'Forums', 'multiple' => '0', 'required' => '1', 'hierarchy' => '1', 'relations' => '0', 'module' => 'forum', 'nodes' => array('forum'))); + $vocabulary = taxonomy_save_vocabulary(array('name' => 'Forums', 'multiple' => 0, 'required' => 1, 'hierarchy' => 1, 'relations' => 0, 'module' => 'forum', 'nodes' => array('forum'))); $vid = $vocabulary['vid']; } variable_set('forum_nav_vocabulary', $vid); diff --git a/modules/taxonomy.module b/modules/taxonomy.module index ea802def7..20b0939db 100644 --- a/modules/taxonomy.module +++ b/modules/taxonomy.module @@ -803,7 +803,13 @@ function _taxonomy_prepare_insert($data, $stage) { } else { foreach (array_values($data) as $value) { - $q[] = "'". str_replace('%', '%%', db_escape_string($value)) ."'"; + //Escape strings, but not integers + if (is_int($value)) { + $q[] = $value; + } + else { + $q[] = "'". str_replace('%', '%%', db_escape_string($value)) ."'"; + } } $result = implode(', ', $q); } diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index ea802def7..20b0939db 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -803,7 +803,13 @@ function _taxonomy_prepare_insert($data, $stage) { } else { foreach (array_values($data) as $value) { - $q[] = "'". str_replace('%', '%%', db_escape_string($value)) ."'"; + //Escape strings, but not integers + if (is_int($value)) { + $q[] = $value; + } + else { + $q[] = "'". str_replace('%', '%%', db_escape_string($value)) ."'"; + } } $result = implode(', ', $q); } |