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
F4046100: D25632.1746737124.diff
Wed, May 7, 20:45
F4011435: D25632.1746625952.diff
Tue, May 6, 13:52
F3841851: D25632.1746100022.diff
Wed, Apr 30, 11:47
F3748885: D25632.1745786639.diff
Sat, Apr 26, 20:43
F3747833: D25632.1745774656.diff
Sat, Apr 26, 17:24
F3737181: D25632.1745759622.diff
Sat, Apr 26, 13:13
F3706252: D25632.1745635618.diff
Fri, Apr 25, 02:46
F3529820: D25632.1744867801.diff
Wed, Apr 16, 05:30

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