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