Commit aacad2c
Fixed passing null to strpos/strrpos/substr etc
Summary:
in PHP 8.1+, passing null to strpos/strrpos/substr etc. emits deprecation warnings, and PHP 9 will make this a fatal error. If this SDK ever targets PHP 9+, you'd want a guard
Per PHP version:
PHP 8.0: silent coercion (null → ""), returns false. No warning.
PHP 8.1 – 8.x: emits an E_DEPRECATED warning, still returns false. Just a log entry, execution continues.
PHP 9.0 (planned): throws an uncaught TypeError. Execution halts at the call site and propagates up the stack — same observable behavior as the JS TypeError we just fixed.
So the fix calculus changes once PHP 9 is in play:
Today (PHP 8.x at Meta): no crash, no fix needed
PHP 9: same crash class as the Node.js bug — would need a similar early-return guard in computeETLDPlus1ForHost
If the team plans to upgrade, applying the analogous PHP guard now would future-proof.
___
overriding_review_checks_triggers_an_audit_and_retroactive_review
Oncall Short Name: advertiser_experience_foundations
Differential Revision: D104760726
fbshipit-source-id: 8665505c6b91a81f440ade4a90e58779a65a169f1 parent a2def12 commit aacad2c
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
348 | 353 | | |
349 | 354 | | |
350 | 355 | | |
| |||
0 commit comments