Page MenuHomePhorge

Viewing a diff fails under PHP 8.1 - src/infrastructure/javelin/markup.php phabricator_form()
Closed, ResolvedPublic

Description

Viewing a diff (eg https://my.phabricator.site/D1234) fails under PHP 8.1 with:

[Fri Jun 30 07:29:00.445048 2023] [proxy_fcgi:error] [pid 2813] [client 10.11.12.13:12345] AH01071: Got error 'PHP message: [2023-06-30 07:29:00] EXCEPTION: (RuntimeException) strcasecmp(): Passing null to parameter #1 ($string1) 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> strcasecmp(NULL, string) called at [<phorge>/src/infrastructure/javelin/markup.php:77]PHP message:   #2 <#2> phabricator_form(PhabricatorUser, array, array) called at [<phorge>/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php:258]PHP message:   #3 <#2> javelin_tag(string, array, PHUITabView) called at [<phorge>/src/view/phui/PHUITabGroupView.php:120]PHP message:   #4 <#2> phutil_tag(string, array, array) called at [<phorge>/src/infrastructure/javelin/markup.php:70]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]'

This is due to the src/infrastructure/javelin/markup.php phabricator_form() not checking the $attributes array has the 'method' key set before doing a strcasecmp() on it

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.