Page MenuHomePhorge

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

Authored by aklapper on Fri, May 10, 10:04.
Tags
None
Referenced Files
Unknown Object (File)
Thu, May 30, 22:18
Unknown Object (File)
Tue, May 21, 01:17
Unknown Object (File)
Mon, May 20, 23:11
Unknown Object (File)
Mon, May 20, 09:00
Unknown Object (File)
Sat, May 18, 14:02
Unknown Object (File)
Fri, May 17, 23:46
Unknown Object (File)
Fri, May 17, 10:59
Unknown Object (File)
Thu, May 16, 01:58

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