Page MenuHomePhorge

PHP 8.1 trim(NULL) error in PhabricatorEditorURIEngine::newForViewer()
Closed, ResolvedPublic

Description

When viewing a diff under PHP 8.1, PhabricatorEditorURIEngine::newForViewer() throws an exception:

AH01071: Got error 'PHP message: [2023-06-30 07:30:05] EXCEPTION: (RuntimeException) trim(): Passing null to parameter
#1 ($string) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261]PHP message: arcanist(head=master, ref.master=8130241a11ac, custom=4), phorge(head=master, ref.master=7c1487e4dcfa)PHP message:
#0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<arcanist>/src/error/PhutilErrorHandler.php:261]PHP message:
#1 <#2> trim(NULL) called at [<phorge>/src/infrastructure/editor/PhabricatorEditorURIEngine.php:19]PHP message:
#2 <#2> PhabricatorEditorURIEngine::newForViewer(PhabricatorUser) called at [<phorge>/src/applications/differential/view/DifferentialChangesetDetailView.php:333]PHP message:
#3 <#2> DifferentialChangesetDetailView::getEditorURITemplate() called at [<phorge>/src/applications/differential/view/DifferentialChangesetDetailView.php:256]PHP message:
#4 <#2> DifferentialChangesetDetailView::render() called at [<phorge>/src/applications/differential/view/DifferentialChangesetListView.php:240]PHP message:
#5 <#2> phutil_tag(string, array, array) called at [<phorge>/src/view/phui/PHUITwoColumnView.php:242]PHP message:
#6 <#2> PHUITwoColumnView::buildFooter() called at [<phorge>/src/view/phui/PHUITwoColumnView.php:123]PHP message:
#7 <#2> PHUITwoColumnView::getTagContent() called at [<phorge>/src/view/AphrontTagView.php:161]PHP message:
#8 <#2> phutil_tag(string, array, array) called at [<phorge>/src/view/formation/PHUIFormationContentView.php:18]PHP message:
#9 <#2> phutil_escape_html(PHUIFormationContentView) called at [<phorge>/src/infrastructure/markup/render.php:139]PHP message:
#10 <#2> phutil_escape_html(array) called at [<phorge>/src/infrastructure/markup/render.php:97]PHP message:
#11 <#2> phutil_tag(string, array, array) called at [<phorge>/src/view/formation/PHUIFormationView.php:67]PHP message:
#12 <#2> PHUIFormationView::render() called at [<phorge>/src/view/AphrontView.php:222]PHP message:
#13 <#2> AphrontView::producePhutilSafeHTML() called at [<phorge>/src/infrastructure/markup/render.php:115]PHP message:
#14 <#2> phutil_escape_html(PHUIFormationView) called at [<phorge>/src/infrastructure/markup/render.php:171]PHP message:
#15 <#2> phutil_implode_html(string, array) called at [<phorge>/src/view/page/PhabricatorBarePageView.php:58]PHP message:
#16 <#2> PhabricatorBarePageView::willRenderPage() called at [<phorge>/src/view/page/PhabricatorStandardPageView.php:216]PHP message:
#17 <#2> PhabricatorStandardPageView::willRenderPage() called at [<phorge>/src/view/page/AphrontPageView.php:46]PHP message:
#18 <#2> AphrontPageView::render() called at [<phorge>/src/view/page/PhabricatorStandardPageView.php:904]PHP message:
#19 <#2> PhabricatorStandardPageView::produceAphrontResponse() called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:722]PHP message:
#20 <#2> AphrontApplicationConfiguration::produceResponse(AphrontRequest, PhabricatorStandardPageView) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:299]PHP message:
#21 phlog(RuntimeException) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]PHP message:
#22 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]PHP message:
#23 AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:337]PHP message:
#24 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:204]PHP message:
#25 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]'

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.