Support Forums - Classified Ads Script Osclass

General osclass questions => Report bug => Topic started by: هشام سدير on June 11, 2024, 07:43:26 PM

Title: Error in osclass - arabic chars - real_escape_string / mysqli_real_escape_string
Post by: هشام سدير on June 11, 2024, 07:43:26 PM
To the esteemed Osclass Support Team,

Greetings,

I would like to bring to your attention an issue on the Osclass website. I am facing a problem when using the site in Arabic. The error appears in the pagination, where it does not switch between pages (from 1 to 2) correctly.

This error occurs only when the site is switched to the Arabic language, which affects the user experience and limits the ability to browse ads or content on the site.

I kindly request you to review this issue and resolve it as soon as possible.

Thank you for your cooperation.

https://epsilon.mb-themes.com/%d9%85%d8%b1%d9%83%d8%a8%d8%a7%d8%aa

https://dev7.abprofitrade.eu/ar/%d9%84%d9%84%d8%a8%d9%8a%d8%b9/2
Title: Re: Error in osclass - real_escape_string / mysqli_real_escape_string
Post by: MB Themes on June 12, 2024, 03:11:53 PM
It's quite interesting issue that is on Osclass probably for very long time.
Problem is that we use urlencode to pass category slug to mysql, that is wrong (chars are escaped).

Go to oc-includes/osclass/model/Category.php
around line 524, find:
Code: [Select]
$slug = urlencode($slug);
Replace it with:
Code: [Select]
$slug = $this->dao->connId->real_escape_string($slug);
$slug = urlencode(urldecode($slug));

Title: Re: Error in osclass - arabic chars - real_escape_string / mysqli_real_escape_string
Post by: هشام سدير on June 14, 2024, 06:10:28 PM
Thank you, the problem has been solved
Title: Re: Error in osclass - arabic chars - real_escape_string / mysqli_real_escape_string
Post by: MB Themes on June 16, 2024, 04:55:07 PM
Thanks for feedback  :)