Skip to content

Commit

Permalink
Use correct property type for various calls
Browse files Browse the repository at this point in the history
  • Loading branch information
AJenbo committed Feb 15, 2024
1 parent 5351219 commit df65e86
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 25 deletions.
10 changes: 5 additions & 5 deletions upload/admin/controller/cms/comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,10 @@ public function approve(): void {
$comment_info = $this->model_cms_article->getComment($article_comment_id);

if ($comment_info) {
$this->model_cms_article->editCommentStatus($article_comment_id, 1);
$this->model_cms_article->editCommentStatus($article_comment_id, true);

if ($comment_info['customer_id']) {
$this->model_customer_customer->editCommenter($comment_info['customer_id'], 1);
$this->model_customer_customer->editCommenter($comment_info['customer_id'], true);

$filter_data = [
'filter_customer_id' => $comment_info['customer_id'],
Expand All @@ -267,7 +267,7 @@ public function approve(): void {
$results = $this->model_cms_article->getComments($filter_data);

foreach ($results as $result) {
$this->model_cms_article->editCommentStatus($result['article_comment_id'], 1);
$this->model_cms_article->editCommentStatus($result['article_comment_id'], true);
}
}
}
Expand Down Expand Up @@ -312,10 +312,10 @@ public function spam(): void {
$comment_info = $this->model_cms_article->getComment($article_comment_id);

if ($comment_info) {
$this->model_cms_article->editCommentStatus($article_comment_id, 0);
$this->model_cms_article->editCommentStatus($article_comment_id, false);

if ($comment_info['customer_id']) {
$this->model_customer_customer->editCommenter($comment_info['customer_id'], 0);
$this->model_customer_customer->editCommenter($comment_info['customer_id'], false);
$this->model_customer_customer->addHistory($comment_info['customer_id'], 'SPAMMER!!!');

// Delete all customer comments
Expand Down
2 changes: 1 addition & 1 deletion upload/admin/controller/common/authorize.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public function validate(): void {
}

if (!$json) {
$this->model_user_user->editAuthorizeStatus($authorize_info['user_authorize_id'], 1);
$this->model_user_user->editAuthorizeStatus($authorize_info['user_authorize_id'], true);
$this->model_user_user->editAuthorizeTotal($authorize_info['user_authorize_id'], 0);

if (isset($this->request->post['redirect'])) {
Expand Down
4 changes: 2 additions & 2 deletions upload/admin/controller/marketplace/cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public function enable(): void {
if (!$json) {
$this->load->model('setting/cron');

$this->model_setting_cron->editStatus($cron_id, 1);
$this->model_setting_cron->editStatus($cron_id, true);

$json['success'] = $this->language->get('text_success');
}
Expand Down Expand Up @@ -279,7 +279,7 @@ public function disable(): void {
if (!$json) {
$this->load->model('setting/cron');

$this->model_setting_cron->editStatus($cron_id, 0);
$this->model_setting_cron->editStatus($cron_id, false);

$json['success'] = $this->language->get('text_success');
}
Expand Down
4 changes: 2 additions & 2 deletions upload/admin/controller/marketplace/event.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public function enable(): void {
if (!$json) {
$this->load->model('setting/event');

$this->model_setting_event->editStatus($event_id, 1);
$this->model_setting_event->editStatus($event_id, true);

$json['success'] = $this->language->get('text_success');
}
Expand Down Expand Up @@ -226,7 +226,7 @@ public function disable(): void {
if (!$json) {
$this->load->model('setting/event');

$this->model_setting_event->editStatus($event_id, 0);
$this->model_setting_event->editStatus($event_id, false);

$json['success'] = $this->language->get('text_success');
}
Expand Down
4 changes: 2 additions & 2 deletions upload/admin/controller/marketplace/installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ public function install(): void {

$zip->close();

$this->model_setting_extension->editStatus($extension_install_id, 1);
$this->model_setting_extension->editStatus($extension_install_id, true);
} else {
$json['error'] = $this->language->get('error_unzip');
}
Expand Down Expand Up @@ -830,7 +830,7 @@ public function uninstall(): void {
}

// Remove extension directory
$this->model_setting_extension->editStatus($extension_install_id, 0);
$this->model_setting_extension->editStatus($extension_install_id, false);

// Remove any OCMOD modifications
$this->load->model('setting/modification');
Expand Down
10 changes: 5 additions & 5 deletions upload/admin/controller/marketplace/marketplace.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function index(): void {
$string .= VERSION . "\n";
$string .= $time . "\n";

$signature = base64_encode(hash_hmac('sha1', $string, $this->config->get('opencart_secret'), 1));
$signature = base64_encode(hash_hmac('sha1', $string, $this->config->get('opencart_secret'), true));

$url = '&username=' . urlencode($this->config->get('opencart_username'));
$url .= '&domain=' . $this->request->server['HTTP_HOST'];
Expand Down Expand Up @@ -553,7 +553,7 @@ public function info(): ?\Opencart\System\Engine\Action {
$string .= $extension_id . "\n";
$string .= $time . "\n";

$signature = base64_encode(hash_hmac('sha1', $string, $this->config->get('opencart_secret'), 1));
$signature = base64_encode(hash_hmac('sha1', $string, $this->config->get('opencart_secret'), true));

$url = '&username=' . urlencode($this->config->get('opencart_username'));
$url .= '&domain=' . $this->request->server['HTTP_HOST'];
Expand Down Expand Up @@ -811,7 +811,7 @@ public function purchase(): void {
$string .= $this->request->post['pin'] . "\n";
$string .= $time . "\n";

$signature = base64_encode(hash_hmac('sha1', $string, $this->config->get('opencart_secret'), 1));
$signature = base64_encode(hash_hmac('sha1', $string, $this->config->get('opencart_secret'), true));

$url = '&username=' . urlencode($this->config->get('opencart_username'));
$url .= '&domain=' . $this->request->server['HTTP_HOST'];
Expand Down Expand Up @@ -893,7 +893,7 @@ public function download(): void {
$string .= $extension_download_id . "\n";
$string .= $time . "\n";

$signature = base64_encode(hash_hmac('sha1', $string, $this->config->get('opencart_secret'), 1));
$signature = base64_encode(hash_hmac('sha1', $string, $this->config->get('opencart_secret'), true));

$url = '&username=' . urlencode($this->config->get('opencart_username'));
$url .= '&domain=' . $this->request->server['HTTP_HOST'];
Expand Down Expand Up @@ -999,7 +999,7 @@ public function addComment(): void {
$string .= urlencode(base64_encode($this->request->post['comment'])) . "\n";
$string .= $time . "\n";

$signature = base64_encode(hash_hmac('sha1', $string, $this->config->get('opencart_secret'), 1));
$signature = base64_encode(hash_hmac('sha1', $string, $this->config->get('opencart_secret'), true));

$url = '&username=' . $this->config->get('opencart_username');
$url .= '&domain=' . $this->request->server['HTTP_HOST'];
Expand Down
6 changes: 3 additions & 3 deletions upload/admin/controller/marketplace/modification.php
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ public function getLog(): string {
$file = DIR_LOGS . 'ocmod.log';

if (is_file($file)) {
return htmlentities(file_get_contents($file, FILE_USE_INCLUDE_PATH, null));
return htmlentities(file_get_contents($file, true, null));
} else {
return '';
}
Expand Down Expand Up @@ -677,7 +677,7 @@ public function enable(): void {
if (!$json) {
$this->load->model('setting/modification');

$this->model_setting_modification->editStatus($modification_id, 1);
$this->model_setting_modification->editStatus($modification_id, true);

$json['success'] = $this->language->get('text_success');
}
Expand Down Expand Up @@ -709,7 +709,7 @@ public function disable(): void {
if (!$json) {
$this->load->model('setting/modification');

$this->model_setting_modification->editStatus($modification_id, 0);
$this->model_setting_modification->editStatus($modification_id, false);

$json['success'] = $this->language->get('text_success');
}
Expand Down
4 changes: 2 additions & 2 deletions upload/admin/controller/marketplace/startup.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public function enable(): void {
if (!$json) {
$this->load->model('setting/startup');

$this->model_setting_startup->editStatus($startup_id, 1);
$this->model_setting_startup->editStatus($startup_id, true);

$json['success'] = $this->language->get('text_success');
}
Expand Down Expand Up @@ -226,7 +226,7 @@ public function disable(): void {
if (!$json) {
$this->load->model('setting/startup');

$this->model_setting_startup->editStatus($startup_id, 0);
$this->model_setting_startup->editStatus($startup_id, false);

$json['success'] = $this->language->get('text_success');
}
Expand Down
2 changes: 1 addition & 1 deletion upload/admin/controller/tool/log.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public function download(): void {
$this->response->addheader('Content-Disposition: attachment; filename="' . $this->config->get('config_name') . '_' . date('Y-m-d_H-i-s', time()) . '_error.log"');
$this->response->addheader('Content-Transfer-Encoding: binary');

$this->response->setOutput(file_get_contents($file, FILE_USE_INCLUDE_PATH, null));
$this->response->setOutput(file_get_contents($file, true, null));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion upload/admin/controller/tool/notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public function info(): void {

$data['text'] = html_entity_decode($notification_info['text'], ENT_QUOTES, 'UTF-8');

$this->model_tool_notification->editStatus($notification_id, 1);
$this->model_tool_notification->editStatus($notification_id, true);

$this->response->setOutput($this->load->view('tool/notification_info', $data));
}
Expand Down
2 changes: 1 addition & 1 deletion upload/catalog/controller/account/authorize.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function validate(): void {
}

if (!$json) {
$this->model_account_customer->editAuthorizeStatus($authorize_info['customer_authorize_id'], 1);
$this->model_account_customer->editAuthorizeStatus($authorize_info['customer_authorize_id'], true);
$this->model_account_customer->editAuthorizeTotal($authorize_info['customer_authorize_id'], 0);

if (isset($this->request->post['redirect'])) {
Expand Down

0 comments on commit df65e86

Please sign in to comment.