joomla-framework / database

Joomla Framework Database Package
GNU General Public License v2.0
28 stars 34 forks source link

[2.0] [PHP 8.1] Fix deprecated null parameter for string functions in the escape method of the drivers #260

Closed richard67 closed 2 years ago

richard67 commented 2 years ago

Pull Request for Issue #

Summary of Changes

Analogue to PR https://github.com/joomla/joomla-cms/pull/36787 for the 3.10-dev branch of the CMS.

Testing Instructions

A code review could be sufficient. Otherwise see https://github.com/joomla/joomla-cms/pull/36787 .

Additional comments

Reading the code I think the return value should be type casted to sting also for the is_int($text) case a bit above the is_float($text) modified here. (There is no PHP 8.1 error at that place but it would be right due to the function documentation).

But that would change behaviour regarding the return value's type in that case, and so I think this should be done with a future clean-up, together with type-hinting the methods.

Documentation Changes Required

None.

richard67 commented 2 years ago

Should I make an analogue PR for the 1.0-dev branch?