Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions upload/admin/controller/blog/article.php
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ protected function getList() {
}

protected function getForm() {
$data['text_form'] = !isset($this->request->get['article_id']) ? $this->language->get('text_add') : $this->language->get('text_edit');

if (isset($this->error['warning'])) {
$data['error_warning'] = $this->error['warning'];
Expand Down
7 changes: 4 additions & 3 deletions upload/admin/controller/blog/category.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ protected function getList() {

if (isset($this->request->get['path'])) {
if ($this->request->get['path'] != '') {
$this->path = explode('_', $this->request->get['path']);
$this->blog_category_id = end($this->path);
$this->session->data['path'] = $this->request->get['path'];
$this->path = explode('_', $this->request->get['path']);
$this->blog_category_id = end($this->path);
$this->session->data['path'] = $this->request->get['path'];
} else {
unset($this->session->data['path']);
}
Expand Down Expand Up @@ -206,6 +206,7 @@ protected function getList() {
}

protected function getForm() {
$data['text_form'] = !isset($this->request->get['blog_category_id']) ? $this->language->get('text_add') : $this->language->get('text_edit');

if (isset($this->error['warning'])) {
$data['error_warning'] = $this->error['warning'];
Expand Down
2 changes: 1 addition & 1 deletion upload/admin/controller/common/forgotten.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function index() {
}

protected function validate() {
if (!isset($this->request->post['email'])) {
if (!isset($this->request->post['email']) || !trim($this->request->post['email'])) {
$this->error['warning'] = $this->language->get('error_email');
} elseif (!$this->model_user_user->getTotalUsersByEmail($this->request->post['email'])) {
Comment on lines +66 to 68
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After checking that the email is not empty with trim(), the subsequent code still uses the untrimmed email value $this->request->post['email'] on lines 21, 68. This means that an email with leading/trailing whitespace would pass the empty check, but downstream code would still receive the email with whitespace. Consider trimming the email value once at the beginning of the validation method and storing it in a variable, or trim it before using it in database queries.

Suggested change
if (!isset($this->request->post['email']) || !trim($this->request->post['email'])) {
$this->error['warning'] = $this->language->get('error_email');
} elseif (!$this->model_user_user->getTotalUsersByEmail($this->request->post['email'])) {
$email = '';
if (isset($this->request->post['email'])) {
$email = trim($this->request->post['email']);
// Normalize the email so subsequent uses (including in index()) see the trimmed value
$this->request->post['email'] = $email;
}
if ($email === '') {
$this->error['warning'] = $this->language->get('error_email');
} elseif (!$this->model_user_user->getTotalUsersByEmail($email)) {

Copilot uses AI. Check for mistakes.
$this->error['warning'] = $this->language->get('error_email');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function chartByCountry() {

$results = $this->model_extension_dashboard_chart_by_country_and_region->getTotalOrdersByCountry();

if($results) {
if ($results) {
foreach ($results as $key => $result) {
$json['data'][] = [
'country_id'=> $result['country_id'],
Expand All @@ -140,4 +140,4 @@ public function chartByCountry() {
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
}
}
2 changes: 1 addition & 1 deletion upload/admin/view/template/blog/article_form.twig
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{% endif %}
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-pencil"></i> {{ text_edit }}</h3>
<h3 class="panel-title"><i class="fa fa-pencil"></i> {{ text_form }}</h3>
</div>
<div class="panel-body">
<form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-article" class="form-horizontal">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@
url: 'index.php?route=extension/dashboard/chart_by_country_and_region/chartByCountry&user_token={{ user_token }}',
dataType: 'json',
success: function(json) {
if(json.data.length > 1) {
data = json.data || 0;
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable data is assigned using a fallback value of 0 (a number), but it's immediately used with .length property which is an array method. If json.data is undefined, data will be 0, and accessing 0.length will result in undefined (not an error, but may lead to unexpected behavior). Consider using an empty array [] as the fallback value instead to ensure consistent behavior with the .length checks.

Suggested change
data = json.data || 0;
data = json.data || [];

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable data is declared without const, let, or var, making it an implicit global variable. This can lead to unintended side effects and conflicts with other code. Declare it with const or let to properly scope the variable.

Suggested change
data = json.data || 0;
const data = json.data || 0;

Copilot uses AI. Check for mistakes.
if (data.length > 1) {
const param = {'elem': country_block, 'clickable': true, 'hoverable': true};

DrawChart(json.data, param);
DrawChart(data, param);

setClickByCounries(json.countries);
} else if (json.data.length == 1) {
} else if (data.length == 1) {
getByRegion(json.countries[0]);

$(region_block).toggleClass('active');
Expand Down
2 changes: 1 addition & 1 deletion upload/catalog/controller/account/forgotten.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function index() {
}

protected function validate() {
if (!isset($this->request->post['email'])) {
if (!isset($this->request->post['email']) || !trim($this->request->post['email'])) {
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After checking that the email is not empty with trim(), the subsequent code still uses the untrimmed email value $this->request->post['email'] on lines 74, 79, and potentially line 21. This means that an email with only whitespace would fail the empty check, but downstream code would still receive a whitespace-only string. Consider trimming the email value once at the beginning of the validation method and storing it in a variable, or trim it before using it in database queries.

Copilot uses AI. Check for mistakes.
$this->error['warning'] = $this->language->get('error_email');
} elseif (!$this->model_account_customer->getTotalCustomersByEmail($this->request->post['email'])) {
$this->error['warning'] = $this->language->get('error_email');
Expand Down
2 changes: 1 addition & 1 deletion upload/install/view/template/common/header.twig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<header>
<div class="container">
<div class="row">
<div id="logo"><img src="view/image/logo.png" alt="ocStore" title="ocStore" /></div>
<div id="logo"><img src="view/image/logo.png" alt="LiveStore" title="LiveStore" /></div>
</div>
</div>
</header>
Expand Down
2 changes: 2 additions & 0 deletions upload/system/library/seopro.php
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,8 @@ private function getKeywordByQuery($query, $language_id = null) {
}

public function validate() {
$this->detectAjax();
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The detectAjax() method is called before $this->request is initialized. The method accesses $this->request->server on line 539, but $this->request is not set until line 37. This will cause a fatal error "Attempt to read property 'server' on null" when the constructor is executed. Either remove this call from line 29 or move it after the request object is initialized.

Copilot uses AI. Check for mistakes.

if (php_sapi_name() === 'cli') {
return;
}
Expand Down