// Fix #PSFV-34
This commit is contained in:
+7
-4
@@ -135,11 +135,14 @@ class FeatureCore extends ObjectModel
|
|||||||
foreach (array_keys($field) as $key)
|
foreach (array_keys($field) as $key)
|
||||||
if (!Validate::isTableOrIdentifier($key))
|
if (!Validate::isTableOrIdentifier($key))
|
||||||
die(Tools::displayError());
|
die(Tools::displayError());
|
||||||
$mode = Db::getInstance()->getRow('SELECT `id_lang` FROM `'.pSQL(_DB_PREFIX_.$this->table).'_lang` WHERE `'.pSQL($this->identifier).
|
|
||||||
'` = '.(int)($this->id).' AND `id_lang` = '.(int)($field['id_lang']));
|
$sql = 'SELECT `id_lang` FROM `'.pSQL(_DB_PREFIX_.$this->table).'_lang`
|
||||||
$result *= (!Db::getInstance()->NumRows()) ? Db::getInstance()->AutoExecute(_DB_PREFIX_.$this->table.'_lang', $field, 'INSERT') :
|
WHERE `'.pSQL($this->identifier).'` = '.(int)$this->id.'
|
||||||
|
AND `id_lang` = '.(int)$field['id_lang'];
|
||||||
|
$mode = Db::getInstance()->getRow($sql);
|
||||||
|
$result &= (!$mode) ? Db::getInstance()->AutoExecute(_DB_PREFIX_.$this->table.'_lang', $field, 'INSERT') :
|
||||||
Db::getInstance()->AutoExecute(_DB_PREFIX_.$this->table.'_lang', $field, 'UPDATE', '`'.
|
Db::getInstance()->AutoExecute(_DB_PREFIX_.$this->table.'_lang', $field, 'UPDATE', '`'.
|
||||||
pSQL($this->identifier).'` = '.(int)($this->id).' AND `id_lang` = '.(int)($field['id_lang']));
|
pSQL($this->identifier).'` = '.(int)$this->id.' AND `id_lang` = '.(int)$field['id_lang']);
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user