Hi everyone,
I'm encountering a deprecation error on my Osclass site and I would like to ask for your help to fix it properly. This error is being triggered specifically when the Cron job runs.
The Error: Deprecated: rawurlencode(): Passing null to parameter #1 ($string) of type string is deprecated in /home/mysite/public_html/oc-includes/osclass/utils.php on line 1481
Context: This error started appearing after upgrading to 8.3.1 version.
It seems that the rawurlencode() function is receiving a null value instead of a string, which is no longer allowed in recent PHP versions.
The code at line 1481 in oc-includes/osclass/utils.php
return rawurlencode($string);
Question: What is the best practice to fix this in the Osclass core? Should I simply cast the variable to a string or add a null check?
For example, would the following change be the recommended approach? return rawurlencode($string ?? '');
Thank you in advance for your help!