*

dsf

  • *****
  • 261 posts
PHP 8.0.x - 404 doesn't work?
« on: May 21, 2023, 12:37:50 AM »
Hi.

Today i switched one site from php 7.4 to 8.0.x. And i see that now the 404 doesn't work at all.

Verified it also here:

https://demo.osclasspoint.com/a1a2

check this and see it returns 301 and 200 status !! and goes to

https://demo.osclasspoint.com/index.php?page=search&sCategory=a1a2

Do i miss something? At php 7.4 Osclass returns a not found page 404.

Thanks
« Last Edit: May 21, 2023, 12:50:34 AM by dsf »

*

MB Themes

Re: PHP 8.0.x - 404 doesn't work?
« Reply #1 on: May 21, 2023, 09:00:27 AM »
That does not sound right until you have category with that name.
There could be impact from integrating language code in URLs that hit whole application, especially rewrite rules.
Is this more PHP related or Osclass version related?
Can you test?
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

dsf

  • *****
  • 261 posts
Re: PHP 8.0.x - 404 doesn't work?
« Reply #2 on: May 21, 2023, 10:54:07 AM »
That does not sound right until you have category with that name.
There could be impact from integrating language code in URLs that hit whole application, especially rewrite rules.
Is this more PHP related or Osclass version related?
Can you test?

I can test of cource, if you tell me what to test. Still since the issue happens in your demo also ....

*

MB Themes

Re: PHP 8.0.x - 404 doesn't work?
« Reply #3 on: May 21, 2023, 04:43:12 PM »
I tested on latest version running on PHP 8 and got redirected to 404
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

dsf

  • *****
  • 261 posts
Re: PHP 8.0.x - 404 doesn't work?
« Reply #4 on: May 22, 2023, 01:02:53 PM »
I tested on latest version running on PHP 8 and got redirected to 404

How can this happen if your own demo has that issue. Sorry i don't get it.

https://demo.osclasspoint.com/index.php?page=search&sCategory=a1a2

and in any case, what that issue is? PHP related or not?

*

dsf

  • *****
  • 261 posts
Re: PHP 8.0.x - 404 doesn't work?
« Reply #5 on: May 22, 2023, 01:38:36 PM »
Check

https://prodaja.org/a1a2

https://adslab.pk/a1a2

https://tobaratos.com/a2a3

MOST of what i could found are experiencing the same issue. And do you realize how serious this bug is? It will impact all google indexing of a site.

*

dsf

  • *****
  • 261 posts
Re: PHP 8.0.x - 404 doesn't work?
« Reply #6 on: May 22, 2023, 01:44:10 PM »
Osclasspoint 8.0.2 works right. After that, 8.1.0 and the latest suffer from the same issue.

And again, in PHP 8.0.x (and probably greater). PHP 7.4 works right.

*

MB Themes

Re: PHP 8.0.x - 404 doesn't work?
« Reply #7 on: May 23, 2023, 05:58:46 PM »
Ok I was able to reproduce a bit.
Code: [Select]
Matched rule: "^(.+)/?$" ... Request URI: "index.php?page=search&sCategory=a1a2"

Matching this rule.

It's particular issue with this category name only, because Params::getParam('sCategory') > 0 ... yes really :)

Solution is to update line 122 in oc-includes/osclass/controller/search.php:
Code: [Select]
if((int)Params::getParam('sCategory') > 0) {
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

dsf

  • *****
  • 261 posts
Re: PHP 8.0.x - 404 doesn't work?
« Reply #8 on: May 23, 2023, 06:24:35 PM »
Not sure what "It's particular issue with this category name only," means.

Whatever non existent url i try, produces same issue. I mean not only "a1a2", if this is what you mean.

/testz
/whatever
/haha

same issue.

thanks, i will try your suggestion and update here. May i ask why this becomes an issue with php 8 and not with previous?

*

dsf

  • *****
  • 261 posts
Re: PHP 8.0.x - 404 doesn't work?
« Reply #9 on: May 23, 2023, 06:31:49 PM »
Checking your own demo

https://demo.osclasspoint.com/testz

i get a redirect to

https://demo.osclasspoint.com/en/index.php?page=search&sCategory=testz

and then a 404. Not sure if this is correct. Didn't work this way before.

Check it yourself

https://httpstatus.io/


&

https://demo.osclasspoint.com/testz

as a url to check.

*

MB Themes

Re: PHP 8.0.x - 404 doesn't work?
« Reply #10 on: May 23, 2023, 06:37:24 PM »
There is no reason to do more testing before applying fix.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

dsf

  • *****
  • 261 posts
Re: PHP 8.0.x - 404 doesn't work?
« Reply #11 on: May 23, 2023, 06:49:32 PM »
Why most of the replies of yours are so, how to describe this, maybe "cryptic"?

I have provided all the links, all the facts, everything, but for some reason you only write what you want.

For example why this is a PHP 8 issue? And why "categories" are used for search and then a 404.

This is not a solution. Please check it when you have more time and let us know. I do not want to pressure or anything.

Thank you

*

MB Themes

Re: PHP 8.0.x - 404 doesn't work?
« Reply #12 on: May 23, 2023, 10:23:06 PM »
Ok I was able to reproduce a bit.
Code: [Select]
Matched rule: "^(.+)/?$" ... Request URI: "index.php?page=search&sCategory=a1a2"

Matching this rule.

It's particular issue with this category name only, because Params::getParam('sCategory') > 0 ... yes really :)

Solution is to update line 122 in oc-includes/osclass/controller/search.php:
Code: [Select]
if((int)Params::getParam('sCategory') > 0) {

You can test on https://epsilon.mb-themes.com/a1a2
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

dsf

  • *****
  • 261 posts
Re: PHP 8.0.x - 404 doesn't work?
« Reply #13 on: May 23, 2023, 10:42:45 PM »
I will. I have to borrow an account first :) since i can't test live any more. Dangerous.

*

dsf

  • *****
  • 261 posts
Re: PHP 8.0.x - 404 doesn't work?
« Reply #14 on: May 23, 2023, 11:19:11 PM »
It seems to work fine for me. I also understood what happened with php ....

Will that be included at some future update?

Thank you