Ultimate SEO Urls

Advanced search result bug - Ultimate SEO Urls

Re: Advanced search result bug

by Piernas » Fri Aug 05, 2022 1:33 am

I've installed an online setup to check if there was any difference - and yes it is. I've found this:

- When I search for an special character that's not in english language I get no results, no matter if the character is in the title of any product.
- When I do the same on the onlune setup it returns all the results that includes special characters and also their simplification, i.e. if I search ofr "ö" I get all the products wiith the "ö" character plus all the ones that includes a regular "o". Same happens with other special characters (ñ returns also n, á returns also a, ç returns also c and so on. So phoenix nicely returns some kind of "sloppy search" so it doesn't matter if you don't type special characters correctly.

For debugging the problem with USU first I have to find out why my local setup is not returning the correct results because it's not practical uploading files by ftp when coding -so if you have some ideas about where to look at please let me know!

Edit: local setup is corrupting characters on search query:

Code: Select all

AND pd.language_id = 1 AND ((pd.products_name LIKE '%�%' OR p.products_model LIKE '%�%' OR m.manufacturers_name LIKE '%�%') )
Strange - I hope it will be easy to find out what's happening.
Piernas
Posts: 96
Joined: Thu Mar 11, 2021 2:16 am
Contact:

Re: Advanced search result bug

by Piernas » Fri Aug 05, 2022 2:33 am

Update: Found that the issue in my localhost setup is happening at the construct function of search class. First thing it does is:

Code: Select all

      $search_str = trim(strtolower($search_str));
If I'm not wrong strtolower should not alter non-ascii characters, but for some reason it's changing these to � in my local setup but not online. Maybe it's because my localhost is hosted on a windows OS?
Piernas
Posts: 96
Joined: Thu Mar 11, 2021 2:16 am
Contact:

Re: Advanced search result bug

by Denzel » Fri Aug 05, 2022 5:13 am

Found this comparison, maybe it will help...
https://www.php.net/manual/en/function. ... olower.php
Denzel
VIP Member
VIP Member
Posts: 98
Joined: Sat Oct 31, 2020 7:22 pm
Contact:

Re: Advanced search result bug

by Piernas » Fri Aug 05, 2022 2:40 pm

I've read several pages but could not find the issue. I've posted it in the general help forum.

Anyway with the mb_strtolower fix the search works again so I'll debug the problem with USU.
Piernas
Posts: 96
Joined: Thu Mar 11, 2021 2:16 am
Contact:

Re: Advanced search result bug

by Denzel » Thu Aug 11, 2022 7:49 am

Got it: In /includes/apps/ultimate_seo_urls/abstracts/page_modules.php - Line 231 - Function cleanParams() add urlencode to $value:

Code: Select all

        $param = $key . '=' . urlencode($value);
and everything works perfect :) @Piernas: please confirm!
Denzel
VIP Member
VIP Member
Posts: 98
Joined: Sat Oct 31, 2020 7:22 pm
Contact:

Re: Advanced search result bug

by Piernas » Thu Aug 11, 2022 10:20 am

Denzel wrote:Got it: In /includes/apps/ultimate_seo_urls/abstracts/page_modules.php - Line 231 - Function cleanParams() add urlencode to $value:

Code: Select all

        $param = $key . '=' . urlencode($value);
and everything works perfect :) @Piernas: please confirm!
Great! looks like you got it, thanks!!
Piernas
Posts: 96
Joined: Thu Mar 11, 2021 2:16 am
Contact: