Skip to content

Commit

Permalink
Fixed some functions in admin attribute controller
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCartpenter committed Jan 20, 2024
1 parent e1daab8 commit 154fa67
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions upload/admin/controller/catalog/attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ protected function getForm(): void {
if (isset($this->request->post['attribute_description'])) {
$data['attribute_description'] = $this->request->post['attribute_description'];
} elseif (isset($this->request->get['attribute_id'])) {
$data['attribute_description'] = $this->model_catalog_attribute->getAttributeDescriptions($this->request->get['attribute_id']);
$data['attribute_description'] = $this->model_catalog_attribute->getDescriptions($this->request->get['attribute_id']);
} else {
$data['attribute_description'] = [];
}
Expand Down Expand Up @@ -396,7 +396,7 @@ protected function validateForm() {
}

foreach ($this->request->post['attribute_description'] as $language_id => $value) {
if ((utf8_strlen($value['name']) < 1) || (utf8_strlen($value['name']) > 64)) {
if ((oc_strlen($value['name']) < 1) || (oc_strlen($value['name']) > 64)) {
$this->error['name'][$language_id] = $this->language->get('error_name');
}
}
Expand Down
2 changes: 1 addition & 1 deletion upload/catalog/model/catalog/review.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ModelCatalogReview extends Model {
* @return void
*/
public function addReview(int $product_id, array $data): void {
$this->db->query("INSERT INTO " . DB_PREFIX . "review SET author = '" . $this->db->escape($data['name']) . "', customer_id = '" . (int)$this->customer->getId() . "', product_id = '" . (int)$product_id . "', text = '" . $this->db->escape($data['text']) . "', rating = '" . (int)$data['rating'] . "', date_added = NOW(), `date_modified` = NOW()");
$this->db->query("INSERT INTO `" . DB_PREFIX . "review` SET `author` = '" . $this->db->escape($data['name']) . "', `customer_id` = '" . (int)$this->customer->getId() . "', `product_id` = '" . (int)$product_id . "', `text` = '" . $this->db->escape($data['text']) . "', `rating` = '" . (int)$data['rating'] . "', `date_added` = NOW(), `date_modified` = NOW()");

$review_id = $this->db->getLastId();

Expand Down

0 comments on commit 154fa67

Please sign in to comment.