strlen() does not accept null as parameter
preg_match() does not accept null as parameter 2 and 3
substr() does not accept null as parameter 1
Closes T15432 partially: Phorge also needs some fixes
Details
Details
- Reviewers
valerio.bozzolan aklapper - Group Reviewers
O1: Blessed Committers - Maniphest Tasks
- T15432: PHP 8.1 "strlen(null)" exceptions block rendering Differential Revision page
See Task description T15432
Diff Detail
Diff Detail
- Repository
- rARC Arcanist
- Branch
- merula
- Lint
No Lint Coverage - Unit
No Test Coverage - Build Status
Buildable 497 Build 497: arc lint + arc unit
Event Timeline
externals/jsonlint/src/Seld/JsonLint/JsonParser.php | ||
---|---|---|
484 | ✅ Verified: this involves a PHP pitfall (string with zero) that is OK here, since this tries to match a ByteOrderMark. | |
externals/jsonlint/src/Seld/JsonLint/Lexer.php | ||
97 | 🔶 This involves the PHP pitfall "zero string" that is evaluated as falsy so it's skipped. Can be a problem here. NOTE: already fixed by D25250 | |
132 | Thanks for this patch 🔴 The $match should be removed from the condition. |
Comment Actions
Thanks for this patch :)
I'm quite sure that D25250 (that is a bit older) covers all of the proposed checks, somehow in a safer way.
Do you want to share some feedback there?
In the meanwhile let's mark this as "requested changes", but it really means "probably not necessary"
externals/jsonlint/src/Seld/JsonLint/JsonParser.php | ||
---|---|---|
484 | NOTE: Already fixed in D25250 | |
externals/jsonlint/src/Seld/JsonLint/Lexer.php | ||
132 | NOTE: already fixed in: D25250 |
Comment Actions
All three changes superseded by D25250 in my understanding. If not, then please reopen. Thanks!