User tests: Successful: Unsuccessful:
Pull Request for Issue # none.
Fixes Deprecated: mysqli_real_escape_string(): Passing null to parameter #2 ($string) of type string is deprecated in libraries/joomla/database/driver/mysqli.php on line 254
Source-code review should be enough here.
Just test that site continues to work.
I saw this error while saving a user in admin aera with CB.
Deprecated: mysqli_real_escape_string(): Passing null to parameter #2 ($string) of type string is deprecated in libraries/joomla/database/driver/mysqli.php on line 254
That warning is not displayed
None.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Title |
|
@beat Does it need to be fixed in the other drivers, too?
And for 4.x it needs to make a PR with the same fix here: https://github.com/joomla-framework/database . Will you do that, or shall I?
And should there maybe be a type cast to string for the call to addcslashes
in line 258?
Ah no, I see it's not necessary since already handled before.
All my PHP 8.1 fixes should be checked if they need to also be done in other Joomla branches as well. Same also as you well asked and checked, if they should be done in other files as well.
At this time, I'm just testing Joomla and CB on PHP 8.1 in all functionality, and fixing in parallel in CB, CB add-ons and Joomla 3.10 and 4.0 things I see (just looking around the fix itself if nearby functions need the same fix). And I guess that I will have a few more days of work to do so at least, way more than I never had to do in a previous PHP new version since PHP 4!
PHP made this strange decision to deprecate null as string in ancient string functions, breaking many code that worked in 8.0. Actually, I think it's not a good decision, ancient string functions should be left alone, and a new string class, like in many OO languages be made native and implicit (e.g. "text".strlen()). Is there a PHP RFC or discussion for that ? is it too late to comment against this for removal in PHP 8.2 ? it will break unneededly a massive amount of PHP code, just because strlen()
and other string functions accept only string
and not ?string
. Or is null value going to be removed alltogether in PHP 9 or10 ?
So, if you have time to check and fix if needed other branches and files, it would be awesome and then just comment in each fix that you checked it and result (as you did above for other functions), so that we all know. If not, I might do it at some time when I catched up other tasks as this takes way longer than planed. Thank you for your reviews and help in all cases
I don't know if I have the time to check everything on other branches, but I can handle the database driver stuff.
For the framework see joomla-framework/database#260 .
Labels |
Added:
?
?
|
Category | Libraries | ⇒ | Libraries Postgresql |
I have tested this item
Code review.
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Hmm I dont like that we try to cast stuff to strings where the original input should have been an string in the first place. So I would like to understand where the issue is comming from, do we have a stack trace?
But I guess we have to do it here to not break the int and float case right?
Hmm I dont like that we try to cast stuff to strings where the original input should have been an string in the first place. So I would like to understand where the issue is comming from, do we have a stack trace?
But I guess we have to do it here to not break the int and float case right?
@zero-24 I've worried especially about the int case, see the additional comment in the description of the PR here: joomla-framework/database#260 .
Will merge this here as workaround for 3.10. But yes I agree with you that we should find a better solution upstream within J4
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-01-23 17:21:39 |
Closed_By | ⇒ | zero-24 | |
Labels |
Added:
?
|
Oh, just saw it got merged. All ok then!
I have tested this item✅ successfully on a807845
Code review.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36787.