Page MenuHomePhorge

Fix PHP 8.1 "preg_replace(null)" exception in PhabricatorEditorURIEngine.php
Needs ReviewPublic

Authored by aklapper on Thu, May 29, 21:33.

Details

Summary

Passing null to preg_replace() is deprecated behavior since PHP 8.1.
Thus check if $repository->getRepositorySlug() is set before passing that to escapeToken().

ERROR 8192: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated at [<phorge>/src/infrastructure/editor/PhabricatorEditorURIEngine.php:283]

Closes T15824

Test Plan

Unknown.

Diff Detail

Repository
rP Phorge
Branch
T15824secondtry (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 2024
Build 2024: arc lint + arc unit