Post by HAO » Thu Sep 02, 2021 1:33 pm

Hello, my OpenCart system has some error messages in PHP Version 7.3.29, Can someone tell me how to deal with it?

Error log file:

Code: Select all

2021-07-24 22:53:51 - PHP Notice:  A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/library/pagination.php on line 38
2021-07-24 22:53:51 - PHP Notice:  A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/library/pagination.php on line 78
2021-07-24 22:53:51 - PHP Notice:  A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/library/pagination.php on line 41
2021-09-01 15:06:38 - PHP Notice:  A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/product/special.php on line 102
2021-09-01 15:06:38 - PHP Notice:  A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/product/special.php on line 299
2021-09-01 15:06:38 - PHP Notice:  A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/product/special.php on line 299
2021-09-01 15:06:38 - PHP Notice:  A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/product/special.php on line 299
2021-09-01 15:06:38 - PHP Notice:  A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/product/special.php on line 307
2021-09-01 15:06:38 - PHP Notice:  A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/product/special.php on line 311
2021-09-01 14:57:19 - PHP Warning:  A non-numeric value encountered in /www/wwwroot/xxx/public_html/vqmod/vqcache/vq2-system_storage_modification_catalog_controller_product_category.php on line 183
2021-09-01 14:57:20 - PHP Warning:  A non-numeric value encountered in /www/wwwroot/xxx/public_html/vqmod/vqcache/vq2-system_storage_modification_catalog_controller_product_category.php on line 397
2021-09-01 14:57:20 - PHP Warning:  A non-numeric value encountered in /www/wwwroot/xxx/public_html/vqmod/vqcache/vq2-system_storage_modification_catalog_controller_product_category.php on line 397
2021-09-01 14:57:20 - PHP Warning:  A non-numeric value encountered in /www/wwwroot/xxx/public_html/vqmod/vqcache/vq2-system_storage_modification_catalog_controller_product_category.php on line 397
2021-09-01 14:57:20 - PHP Warning:  A non-numeric value encountered in /www/wwwroot/xxx/public_html/vqmod/vqcache/vq2-system_storage_modification_catalog_controller_product_category.php on line 405
2021-09-01 14:57:20 - PHP Warning:  A non-numeric value encountered in /www/wwwroot/xxx/public_html/vqmod/vqcache/vq2-system_storage_modification_catalog_controller_product_category.php on line 409
2021-09-01 15:06:11 - PHP Notice:  A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/product/manufacturer.php on line 180
2021-09-01 15:06:11 - PHP Notice:  A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/product/manufacturer.php on line 377
2021-09-01 15:06:11 - PHP Notice:  A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/product/manufacturer.php on line 377
2021-09-01 15:06:11 - PHP Notice:  A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/product/manufacturer.php on line 377
2021-09-01 15:06:11 - PHP Notice:  A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/product/manufacturer.php on line 385
2021-09-01 15:06:11 - PHP Notice:  A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/product/manufacturer.php on line 389
2021-09-01 15:05:16 - PHP Warning:  A non-numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/product/manufacturer.php on line 180
2021-09-01 15:05:16 - PHP Warning:  A non-numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/product/manufacturer.php on line 377
2021-09-01 15:05:16 - PHP Warning:  A non-numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/product/manufacturer.php on line 377
2021-09-01 15:05:16 - PHP Warning:  A non-numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/product/manufacturer.php on line 377
2021-09-01 15:05:16 - PHP Warning:  A non-numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/product/manufacturer.php on line 385
2021-09-01 15:05:16 - PHP Warning:  A non-numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/product/manufacturer.php on line 389
2021-09-01 15:33:23 - PHP Warning:  A non-numeric value encountered in /www/wwwroot/xxx/public_html/vqmod/vqcache/vq2-system_storage_modification_catalog_controller_product_search.php on line 217
2021-09-01 15:33:24 - PHP Warning:  A non-numeric value encountered in /www/wwwroot/xxx/public_html/vqmod/vqcache/vq2-system_storage_modification_catalog_controller_product_search.php on line 479
2021-09-01 15:33:24 - PHP Warning:  A non-numeric value encountered in /www/wwwroot/xxx/public_html/vqmod/vqcache/vq2-system_storage_modification_catalog_controller_product_search.php on line 479
2021-09-01 15:33:24 - PHP Warning:  A non-numeric value encountered in /www/wwwroot/xxx/public_html/vqmod/vqcache/vq2-system_storage_modification_catalog_controller_product_search.php on line 479
2021-09-01 15:33:24 - PHP Warning:  A non-numeric value encountered in /www/wwwroot/xxx/public_html/vqmod/vqcache/vq2-system_storage_modification_catalog_controller_product_search.php on line 487
2021-09-01 15:33:24 - PHP Warning:  A non-numeric value encountered in /www/wwwroot/xxx/public_html/vqmod/vqcache/vq2-system_storage_modification_catalog_controller_product_search.php on line 491
2021-09-01 15:32:17 - PHP Notice:  A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/vqmod/vqcache/vq2-system_storage_modification_catalog_controller_product_search.php on line 479
2021-09-01 15:32:17 - PHP Notice:  A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/vqmod/vqcache/vq2-system_storage_modification_catalog_controller_product_search.php on line 487
2021-09-01 15:32:17 - PHP Notice:  A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/vqmod/vqcache/vq2-system_storage_modification_catalog_controller_product_search.php on line 491
2021-09-01 15:32:21 - PHP Notice:  A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/vqmod/vqcache/vq2-system_storage_modification_catalog_controller_product_search.php on line 217
2021-09-01 15:17:56 - PHP Notice:  A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/module/journal2_super_filter.php on line 671
2021-09-01 15:17:59 - PHP Notice:  A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/module/journal2_super_filter.php on line 671
2021-09-01 15:18:02 - PHP Notice:  A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/module/journal2_super_filter.php on line 671
2021-09-01 15:18:19 - PHP Notice:  A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/module/journal2_super_filter.php on line 671
2021-09-01 15:27:04 - PHP Notice:  A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/module/journal2_super_filter.php on line 671
2021-09-01 15:12:01 - PHP Notice:  A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/vqmod/vqcache/vq2-system_storage_modification_catalog_controller_product_category.php on line 183
2021-09-01 15:12:02 - PHP Notice:  A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/vqmod/vqcache/vq2-system_storage_modification_catalog_controller_product_category.php on line 397
2021-09-01 15:12:02 - PHP Notice:  A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/vqmod/vqcache/vq2-system_storage_modification_catalog_controller_product_category.php on line 397
2021-09-01 15:12:02 - PHP Notice:  A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/vqmod/vqcache/vq2-system_storage_modification_catalog_controller_product_category.php on line 397
2021-09-01 15:12:02 - PHP Notice:  A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/vqmod/vqcache/vq2-system_storage_modification_catalog_controller_product_category.php on line 409
Thank you!

HAO
Active Member

Posts

Joined
Fri Jun 03, 2011 2:52 pm

Post by by mona » Thu Sep 02, 2021 3:45 pm

Please always post your OC version / theme / extensions
https://www.opencart.com/index.php?rout ... n_id=38012

2021-07-24 22:53:51 - PHP Notice: A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/library/pagination.php on line 38
2021-07-24 22:53:51 - PHP Notice: A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/library/pagination.php on line 78
2021-07-24 22:53:51 - PHP Notice: A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/library/pagination.php on line 41
2021-09-01 15:06:38 - PHP Notice: A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/product/special.php on line 102
2021-09-01 15:06:38 - PHP Notice: A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/product/special.php on line 299
2021-09-01 15:06:38 - PHP Notice: A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/product/special.php on line 299
2021-09-01 15:06:38 - PHP Notice: A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/product/special.php on line 299
2021-09-01 15:06:38 - PHP Notice: A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/product/special.php on line 307

etc etc etc ..

2021-09-01 15:17:56 - PHP Notice: A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/module/journal2_super_filter.php on line 671
2021-09-01 15:17:59 - PHP Notice: A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/module/journal2_super_filter.php on line 671
2021-09-01 15:18:02 - PHP Notice: A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/module/journal2_super_filter.php on line 671
2021-09-01 15:18:19 - PHP Notice: A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/module/journal2_super_filter.php on line 671
2021-09-01 15:27:04 - PHP Notice: A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/system/storage/modification/catalog/controller/module/journal2_super_filter.php on line 671


2021-09-01 15:12:01 - PHP Notice: A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/vqmod/vqcache/vq2-system_storage_modification_catalog_controller_product_category.php on line 183
2021-09-01 15:12:02 - PHP Notice: A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/vqmod/vqcache/vq2-system_storage_modification_catalog_controller_product_category.php on line 397
2021-09-01 15:12:02 - PHP Notice: A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/vqmod/vqcache/vq2-system_storage_modification_catalog_controller_product_category.php on line 397
2021-09-01 15:12:02 - PHP Notice: A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/vqmod/vqcache/vq2-system_storage_modification_catalog_controller_product_category.php on line 397
2021-09-01 15:12:02 - PHP Notice: A non well formed numeric value encountered in /www/wwwroot/xxx/public_html/vqmod/vqcache/vq2-system_storage_modification_catalog_controller_product_category.php on line 409

You need to contact the developer of the extension / theme for that.

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by HAO » Thu Sep 02, 2021 4:07 pm

I forgot to modify my environment version, My environment:
OpenCart 2.3.0.2
Journal v.2.16.8

And I confirm all the code lines related to the extension, All are the same as OpenCart 2.3.0.2 original files, Can you check for me which side of the code in this range needs to be fixed?

I will ask the author about Journal v.2.16.8, But I need your help for other files.

Because these have nothing to do with the addition of the extension code.

HAO
Active Member

Posts

Joined
Fri Jun 03, 2011 2:52 pm

Post by OSWorX » Thu Sep 02, 2021 4:14 pm

HAO wrote:
Thu Sep 02, 2021 4:07 pm
I will ask the author about Journal v.2.16.8, But I need your help for other files.

Because these have nothing to do with the addition of the extension code.
Not true, because if you check those messages, you wil see that all files are "modified" - by an extension.
If it would be an "unmodified" shop, either no messages like that would happen or you are using a php version > 7.3

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member
Online

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by HAO » Thu Sep 02, 2021 4:19 pm

If I compare it with the original OpenCart 2.3.0.2 file, can you tell which code is wrong in the line related to PHP Version 7.3.29?

2.3.0.2-compiled/upload/system/library/pagination.php
Original file

Code: Select all

		if ($page > 1) {
			$output .= '<li><a href="' . str_replace(array('&amp;page={page}', '&page={page}'), '', $this->url) . '">' . $this->text_first . '</a></li>';
			
			if ($page - 1 === 1) {
				$output .= '<li><a href="' . str_replace(array('&amp;page={page}', '&page={page}'), '', $this->url) . '">' . $this->text_prev . '</a></li>';
			} else {
				$output .= '<li><a href="' . str_replace('{page}', $page - 1, $this->url) . '">' . $this->text_prev . '</a></li>';
			}
		}
My file

Code: Select all

		if ($page > 1) {
			$output .= '<li><a href="' . str_replace(array('&amp;page={page}', '&page={page}', '?page={page}'), '', $this->url) . '">' . $this->text_first . '</a></li>';
			
			if ($page - 1 == 1) {
				$output .= '<li><a href="' . str_replace(array('&amp;page={page}', '&page={page}', '?page={page}'), '', $this->url) . '">' . $this->text_prev . '</a></li>';
			} else {
				$output .= '<li><a href="' . str_replace('{page}', $page - 1, $this->url) . '">' . $this->text_prev . '</a></li>';
			}
		}
Line 38
Original file

Code: Select all

			if ($page - 1 === 1) {
My file

Code: Select all

			if ($page - 1 == 1) {
Line 41

Code: Select all

				$output .= '<li><a href="' . str_replace('{page}', $page - 1, $this->url) . '">' . $this->text_prev . '</a></li>';
Both the same
Line 78

Code: Select all

			$output .= '<li><a href="' . str_replace('{page}', $page + 1, $this->url) . '">' . $this->text_next . '</a></li>';
Both the same

catalog/controller/product/special.php
Line 93

Code: Select all

			'start' => ($page - 1) * $limit,
Line 256

Code: Select all

		$data['results'] = sprintf($this->language->get('text_pagination'), ($product_total) ? (($page - 1) * $limit) + 1 : 0, ((($page - 1) * $limit) > ($product_total - $limit)) ? $product_total : ((($page - 1) * $limit) + $limit), $product_total, ceil($product_total / $limit));
Line 264

Code: Select all

		    $this->document->addLink($this->url->link('product/special', 'page='. ($page - 1), true), 'prev');
All the same
catalog/controller/product/category.php
Line 174

Code: Select all

				'start'              => ($page - 1) * $limit,
Line 349

Code: Select all

			$data['results'] = sprintf($this->language->get('text_pagination'), ($product_total) ? (($page - 1) * $limit) + 1 : 0, ((($page - 1) * $limit) > ($product_total - $limit)) ? $product_total : ((($page - 1) * $limit) + $limit), $product_total, ceil($product_total / $limit));
Line 361

Code: Select all

			    $this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'] . '&page='. ($page + 1), true), 'next');
This is the result of my comparison using the original "2.3.0.2-compiled" file, So can you tell me how to solve it?
Last edited by HAO on Thu Sep 02, 2021 4:58 pm, edited 1 time in total.

HAO
Active Member

Posts

Joined
Fri Jun 03, 2011 2:52 pm

Post by JNeuhoff » Thu Sep 02, 2021 4:38 pm

Just do a filediff for the original and the modified PHP file. If you don't know how to do that you can find a professional developer to look into it from the commercial support section of this forum.

Chances are the issue is caused by one of your extension. Also, you are using the Journal2 framework, which makes your website 3/4 non-OpenCart, hence you should really get in touch with the Journal support, or use another proper standard-compliant web theme.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by HAO » Thu Sep 02, 2021 5:02 pm

JNeuhoff wrote:
Thu Sep 02, 2021 4:38 pm
Just do a filediff for the original and the modified PHP file. If you don't know how to do that you can find a professional developer to look into it from the commercial support section of this forum.

Chances are the issue is caused by one of your extension. Also, you are using the Journal2 framework, which makes your website 3/4 non-OpenCart, hence you should really get in touch with the Journal support, or use another proper standard-compliant web theme.
I have edited the post, but I found that this is a problem with OpenCart itself, Do you think I can't get a solution here?

Because this has nothing to do with the expansion module I installed.
ADD Creative wrote:
Thu Sep 02, 2021 4:53 pm
Probably just this. https://github.com/opencart/opencart/is ... -469652397
I have found the original code, can you tell me how to solve it?

Thank you!

HAO
Active Member

Posts

Joined
Fri Jun 03, 2011 2:52 pm

Post by ADD Creative » Thu Sep 02, 2021 9:50 pm

See. https://github.com/opencart/opencart/co ... 90f4b4d2d9

In any controller that uses page. Replace.

Code: Select all

$page = $this->request->get['page'];
With

Code: Select all

$page = (int)$this->request->get['page'];

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by boopbeepforum » Thu Oct 20, 2022 5:15 am

I noticed these errors, but they're pointing to $limit instead of $page.
I'm running IP-CAM's 1.5.6.5_rc, which already has all of the (int) added to:

Code: Select all

$page = (int)$this->request->get['page'];
I'm getting:

Code: Select all

A non-numeric value encountered
A non well formed numeric value encountered
in catalog/controller/product/manufacturer.php on line xxx (in my vqcache)
which is:
'start'  => ($page - 1) * $limit,
Followed by the same error "A non well formed numeric value encountered" (but not the non-numeric error) in:

Code: Select all

system/library/pagination.php
line 32: $num_pages = ceil($total / $limit);
line 88: ($total) ? (($page - 1) * $limit) + 1 : 0,
line 89: ((($page - 1) * $limit) > ($total - $limit)) ? $total : ((($page - 1) * $limit) + $limit),
However, pagination.php already has this:

Code: Select all

if (!(int)$this->limit) {
$limit = 10;
} else {
$limit = $this->limit;
}
So I'm not sure how this is happening.

Should (int) be added to $limit for all controllers?

Code: Select all

if (isset($this->request->get['limit'])) {
   $limit = (int)$this->request->get['limit'];
} else {
   $limit = $this->config->get('config_catalog_limit');
}
Or does this error have no effect on security?

Newbie

Posts

Joined
Tue May 18, 2021 9:40 pm

Post by boopbeepforum » Thu Oct 20, 2022 5:25 am

Ah, I see that the current opencart version has changed the $limit part to:

Code: Select all

if (isset($this->request->get['limit']) && (int)$this->request->get['limit']) {
	$limit = (int)$this->request->get['limit'];
} else {
	$limit = (int)$this->config->get('config_pagination');
}
So I guess I should do something similar (except changing config_pagination to config_catalog_limit).

Newbie

Posts

Joined
Tue May 18, 2021 9:40 pm

Post by ADD Creative » Thu Oct 20, 2022 5:49 am

boopbeepforum wrote:
Thu Oct 20, 2022 5:15 am
Should (int) be added to $limit for all controllers?

Code: Select all

if (isset($this->request->get['limit'])) {
   $limit = (int)$this->request->get['limit'];
} else {
   $limit = $this->config->get('config_catalog_limit');
}
Or does this error have no effect on security?
That would be correct to stop the errors. Not necessary for security, as the value is escaped elsewhere. Although could help if you had a bad extension.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom
Who is online

Users browsing this forum: No registered users and 120 guests