@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

PHP 8.1 "preg_match(null)" exception in javelin/markup.php when http_action not set

Summary:
Accessing a project's workboard URL of a non-existing workboard shows RunTimeException in PHP 8.1:

preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated

Closes T15262

Test Plan: Page whether to create a workboard for a project was displayed after this change

Reviewers: O1 Blessed Committers, avivey, valerio.bozzolan

Reviewed By: O1 Blessed Committers, avivey, valerio.bozzolan

Subscribers: avivey, speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15262

Differential Revision: https://we.phorge.it/D25131

+5 -2
+1 -1
src/aphront/AphrontRequest.php
··· 448 448 } 449 449 450 450 private function getPrefixedCookieName($name) { 451 - if (strlen($this->cookiePrefix)) { 451 + if (phutil_nonempty_string($this->cookiePrefix)) { 452 452 return $this->cookiePrefix.'_'.$name; 453 453 } else { 454 454 return $name;
+4 -1
src/infrastructure/javelin/markup.php
··· 77 77 $is_post = (strcasecmp($http_method, 'POST') === 0); 78 78 79 79 $http_action = idx($attributes, 'action'); 80 - $is_absolute_uri = preg_match('#^(https?:|//)#', $http_action); 80 + $is_absolute_uri = 0; 81 + if (phutil_nonempty_string($http_action)) { 82 + $is_absolute_uri = preg_match('#^(https?:|//)#', $http_action); 83 + } 81 84 82 85 if ($is_post) { 83 86