Subject: Cache Osclass Plugin 1.5.1 – cache key drops parameters with value "0" (wrong page served for sCompany,0 filter)
Hello,
I am using Cache Osclass Plugin 1.5.1 (Epsilon theme, Osclass 8.x) and found a bug that makes the cache serve the wrong page for any search URL that contains a parameter whose value is 0.
What happens
On a category page, the Epsilon theme has "All / Individual / Company" tabs, which use the search parameter sCompany (0 = individual, 1 = company):
/search/category,example-category/sCompany,1 (company) works correctly: 390 listings.
/search/category,example-category/sCompany,0 (individual) shows the unfiltered category page (585 listings) instead of the 195 individual listings. The URL changes, but the listings do not.
This only affects logged-out visitors, because logged-in users bypass the cache (logged option is off).
How I verified it is the cache plugin
1- The page returned for sCompany,0 contains the plugin's own HTML comments. The cache key is:
sCompany,0 → <!--cac-key:page=search;lang=en_us;scategory=example-category-->
sCompany,1 → <!--cac-key:page=search;lang=en_us;scategory=example-category;scompany=1-->
The scompany part is missing for the 0 value, so the key is identical to the plain category page and the cached unfiltered page is served.
2- The same URL with an extra random parameter (new cache key) returns the correct 195 listings, so the theme's filter logic is fine.
3- After disabling the Cache plugin, all three URLs are correct: 585 (all), 195 (sCompany,0), 390 (sCompany,1). 195 + 390 = 585.
Root cause
In functions.php, function cac_get_name() (around the line that reads $params = array_filter($params)

, the parameters are passed through PHP's array_filter() without a callback. PHP treats the string "0" as empty, so every parameter whose value is 0 is silently removed from the cache key. The same line also removes mobile=0.
Suggested fix
Only remove truly empty values and keep "0":
$params = array_filter($params, function($v) {
return !($v === '' || $v === null || $v === false || $v === array());
});
I tested the key generation outside the plugin: with the original code, the keys for the category page and for sCompany=0 are identical; with the change above they are different (...;scompany=0), while sCompany=1 stays unchanged.
Please let me know if this can be fixed in an official update. Until then, I have to keep the plugin disabled, which affects site performance.
Thank you.