svalavuo пре 4 дана
родитељ
комит
7a3a760a73
1 измењених фајлова са 3 додато и 2 уклоњено
  1. 3 2
      includes/wordpress_import.php

+ 3 - 2
includes/wordpress_import.php

@@ -317,13 +317,14 @@ class WordPressImport {
             
             if (!empty($postIds)) {
                 $placeholders = str_repeat('?,', count($postIds) - 1) . '?';
-                $categoriesStmt = $this->wpDb->query("
+                $categoriesStmt = $this->wpDb->prepare("
                     SELECT tr.object_id as post_id, t.name as category_name
                     FROM wp_term_relationships tr
                     JOIN wp_term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id
                     JOIN wp_terms t ON tt.term_id = t.term_id
                     WHERE tt.taxonomy = 'category' AND tr.object_id IN ($placeholders)
-                ", $postIds);
+                ");
+                $categoriesStmt->execute($postIds);
                 
                 foreach ($categoriesStmt->fetchAll() as $cat) {
                     $categoriesMap[$cat['post_id']][] = $cat['category_name'];