1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-25 08:12:40 +01:00

Fix a PHP 8.1 issue related to preg_match() and null subject

Summary:
This change fixes 'arc patch' in some circumstances.

Closes T15254

Test Plan: I was able to run "arc patch D25111" without issues

Reviewers: O1 Blessed Committers, Matthew

Reviewed By: O1 Blessed Committers, Matthew

Subscribers: speck, tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15187, T15254

Differential Revision: https://we.phorge.it/D25123
This commit is contained in:
Valerio Bozzolan 2023-04-14 22:12:36 +02:00
parent 08dfffd5ca
commit f4a639944d

View file

@ -600,7 +600,7 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI {
public function getCanonicalRevisionName($string) { public function getCanonicalRevisionName($string) {
$match = null; $match = null;
if (preg_match('/@([0-9]+)$/', $string, $match)) { if ($string !== null && preg_match('/@([0-9]+)$/', $string, $match)) {
$stdout = $this->getHashFromFromSVNRevisionNumber($match[1]); $stdout = $this->getHashFromFromSVNRevisionNumber($match[1]);
} else { } else {
list($stdout) = $this->execxLocal( list($stdout) = $this->execxLocal(