Support Forums - Classified Ads Script Osclass
General osclass questions => Report bug => Topic started by: dsf 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
-
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?
-
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 ....
-
I tested on latest version running on PHP 8 and got redirected to 404
-
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?
-
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.
-
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.
-
Ok I was able to reproduce a bit.
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:
if((int)Params::getParam('sCategory') > 0) {
-
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?
-
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.
-
There is no reason to do more testing before applying fix.
-
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
-
Ok I was able to reproduce a bit.
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:
if((int)Params::getParam('sCategory') > 0) {
You can test on https://epsilon.mb-themes.com/a1a2
-
I will. I have to borrow an account first :) since i can't test live any more. Dangerous.
-
It seems to work fine for me. I also understood what happened with php ....
Will that be included at some future update?
Thank you
-
@dsf
Yes it will be included in 8.2.0
-
Hi,
Works fine UNLESS you use a number instead of characters or a mix of characters AND numbers
www. website . com / 827364
www. website . com / 827364test
www. website . com / test827364
I think this must be examined more carefully.