@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.

Fix PHP 8.1 "strlen(null)" and preg_match() exceptions which block rendering "Browse Subscribers" overlay dialog

Summary:
`strlen()` was used in Phabricator to check if a generic value is a non-empty string.
This behavior is deprecated since PHP 8.1. Phorge adopts `phutil_nonempty_string()` as a replacement.

Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.

Similarly, `preg_match()` does not accept passing `null` as `$subject` parameter since PHP 8.1.

Closes T15381

Test Plan: Applied these two changes (on top of D25179 and D25213), and on the task creation page, after clicking the magnifier icon in the "Subscribers" field, the "Browse Subscribers" overlay dialog got rendered.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

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

Maniphest Tasks: T15381

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

+2 -2
+1 -1
src/applications/owners/typeahead/PhabricatorOwnersPackageDatasource.php
··· 26 26 27 27 // If the user is querying by monogram explicitly, like "O123", do an ID 28 28 // search. Otherwise, do an ngram substring search. 29 - if (preg_match('/^[oO]\d+\z/', $raw_query)) { 29 + if ($raw_query && preg_match('/^[oO]\d+\z/', $raw_query)) { 30 30 $id = trim($raw_query, 'oO'); 31 31 $id = (int)$id; 32 32 $query->withIDs(array($id));
+1 -1
src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php
··· 2449 2449 PhabricatorSearchNgrams $index, 2450 2450 $value) { 2451 2451 2452 - if (strlen($value)) { 2452 + if (phutil_nonempty_string($value)) { 2453 2453 $this->ngrams[] = array( 2454 2454 'index' => $index, 2455 2455 'value' => $value,