Page MenuHomePhorge

Fix PHP 8.1 "preg_match(null)" exception for missing Content-Type
ClosedPublic

Authored by aklapper on May 10 2024, 10:04.
Tags
None
Referenced Files
F2982096: D25632.1739944768.diff
Tue, Feb 18, 05:59
F2979505: D25632.1739858047.diff
Mon, Feb 17, 05:54
F2960599: D25632.1739151425.diff
Sun, Feb 9, 01:37
F2960558: D25632.1739151330.diff
Sun, Feb 9, 01:35
F2944317: D25632.1738264187.diff
Wed, Jan 29, 19:09
F2938390: D25632.1737994427.diff
Sun, Jan 26, 16:13
F2937419: D25632.1737959612.diff
Sun, Jan 26, 06:33
F2913262: D25632.1737424793.diff
Jan 20 2025, 01:59

Details

Summary

When the Content-Type HTTP header is empty or missing, null is passed to preg_match() which is deprecated behavior since PHP 8.1. Thus only call preg_match() when the value is set.

ERROR 8192: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated at [$HOME/arcanist/src/future/http/status/HTTPFutureHTTPResponseStatus.php:24]

Closes T15821

Test Plan

Visit something using HTTPFutureHTTPResponseStatus, like, a profile image. No crashes.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable