You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not checking if file exists in class lib/OpenPayU/Oauth/Cache/OauthCacheFile.php causes PHP to throw errors.
Using @ doesn't suppress the errors if custom error handler is used, and since PHP 8, it is impossible to detect if @ was used in custom error handlers because of a "fix" of a bug that was widely accepted as a proper behaviour by the PHP community.
There is a simple fix to this problem - use PHP function file_exists() in get(), set() and invalidate() methods, which is the proper way of doing things in modern PHP.
The function is available since PHP 4 while openpayu_php requires PHP >= 5.3, which means there is no issue with compatibility.
Otherwise, users themselves would need to write some code specifically to suppress the warnings in you class in their error handlers.
Thanks.
The text was updated successfully, but these errors were encountered:
Hello,
Not checking if file exists in class lib/OpenPayU/Oauth/Cache/OauthCacheFile.php causes PHP to throw errors.
Using @ doesn't suppress the errors if custom error handler is used, and since PHP 8, it is impossible to detect if @ was used in custom error handlers because of a "fix" of a bug that was widely accepted as a proper behaviour by the PHP community.
There is a simple fix to this problem - use PHP function
file_exists()
inget()
,set()
andinvalidate()
methods, which is the proper way of doing things in modern PHP.The function is available since PHP 4 while openpayu_php requires PHP >= 5.3, which means there is no issue with compatibility.
Otherwise, users themselves would need to write some code specifically to suppress the warnings in you class in their error handlers.
Thanks.
The text was updated successfully, but these errors were encountered: