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
F3341897: D25632.1743658601.diff
Wed, Apr 2, 05:36
F3336445: D25632.1743574861.diff
Tue, Apr 1, 06:21
F3336433: D25632.1743574512.diff
Tue, Apr 1, 06:15
F3334897: D25632.1743555053.diff
Tue, Apr 1, 00:50
F3329692: D25632.1743479203.diff
Mon, Mar 31, 03:46
F3328392: D25632.1743456100.diff
Sun, Mar 30, 21:21
F3311645: D25632.1743206738.diff
Fri, Mar 28, 00:05
F3299878: D25632.1743029668.diff
Tue, Mar 25, 22:54

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