in phpmyfaq/inc/PMF_Category/Helper.php:
Code: Select all
public function swapCategories($firstCategoryId, $secondCategoryId)
{
$temp_cat = rand(200000, 400000);
$tables = array(
array('faqcategories' => 'id'),
array('faqcategories' => 'parent_id'),
array('faqcategoryrelations' => 'category_id'),
array('faqquestions' => 'ask_rubrik'),
array('faqcategory_group' => 'category_id'),
array('faqcategory_user' => 'category_id'));
$result = true;
foreach ($tables as $pair) {
foreach ($tables as $pair) {
foreach ($pair as $_table => $_field) {
$result = $result && $this->db->query(sprintf("UPDATE %s SET %s = %d WHERE %s = %d",
SQLPREFIX.$_table,
$_field,
$temp_cat,
$_field,
$secondCategoryId));
$result = $result && $this->db->query(sprintf("UPDATE %s SET %s = %d WHERE %s = %d",
SQLPREFIX.$_table,
$_field,
$secondCategoryId,
$_field,
$firstCategoryId));
$result = $result && $this->db->query(sprintf("UPDATE %s SET %s = %d WHERE %s = %d",
SQLPREFIX.$_table,
$_field,
$firstCategoryId,
$_field,
$temp_cat));
}
}
$result = $this->db->query($query);
...
=> where is $query coming from?
Attached is a patch that removes this.