Page MenuHomePhorge

PhabricatorController: fix Caption (can be a string but also PhutilSafeHTML) causing error in PhabricatorPhabricatorAuthProvider
Closed, ResolvedPublic

Description

To reproduce this issue, visit this page:

/auth/config/edit/?provider=PhabricatorPhabricatorAuthProvider

Stack trace:

[Fri May 19 14:23:35.506028 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692] [2023-05-19 14:23:35] EXCEPTION: (InvalidArgumentException) Call to phutil_nonempty_string() expected null or a string, got: PhutilSafeHTML. at [<arcanist>/src/utils/utils.php:2127]
[Fri May 19 14:23:35.506647 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692] arcanist(head=arcpatch-D25049, ref.master=c14785c3795c, ref.arcpatch-D25049=1b6412c24640), phorge(head=arcpatch-D25216_1, ref.master=2df7ea13a387, ref.arcpatch-D25216_1=02b40a9e25eb)
[Fri May 19 14:23:35.506661 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692]   #0 <#2> phutil_nonempty_string(PhutilSafeHTML) called at [<phorge>/src/view/form/control/AphrontFormControl.php:206]
[Fri May 19 14:23:35.506665 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692]   #1 <#2> phutil_tag(string, array, array) called at [<phorge>/src/view/form/PHUIFormLayoutView.php:54]
[Fri May 19 14:23:35.506667 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692]   #2 <#2> PHUIFormLayoutView::render() called at [<phorge>/src/view/form/AphrontFormView.php:160]
[Fri May 19 14:23:35.506670 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692]   #3 <#2> phutil_tag(string, array, array) called at [<phorge>/src/infrastructure/javelin/markup.php:70]
[Fri May 19 14:23:35.506672 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692]   #4 <#2> phutil_escape_html(array) called at [<phorge>/src/infrastructure/markup/render.php:139]
[Fri May 19 14:23:35.506675 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692]   #5 <#2> phutil_escape_html(array) called at [<phorge>/src/infrastructure/markup/render.php:97]
[Fri May 19 14:23:35.506678 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692]   #6 <#2> phutil_tag(string, array, array) called at [<phorge>/src/view/phui/PHUITwoColumnView.php:242]
[Fri May 19 14:23:35.506680 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692]   #7 <#2> PHUITwoColumnView::buildFooter() called at [<phorge>/src/view/phui/PHUITwoColumnView.php:123]
[Fri May 19 14:23:35.506683 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692]   #8 <#2> PHUITwoColumnView::getTagContent() called at [<phorge>/src/view/AphrontTagView.php:161]
[Fri May 19 14:23:35.506685 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692]   #9 <#2> AphrontTagView::render() called at [<phorge>/src/view/AphrontView.php:222]
[Fri May 19 14:23:35.506688 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692]   #10 <#2> AphrontView::producePhutilSafeHTML() called at [<phorge>/src/infrastructure/markup/render.php:115]
[Fri May 19 14:23:35.506691 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692]   #11 <#2> phutil_escape_html(PHUITwoColumnView) called at [<phorge>/src/infrastructure/markup/render.php:171]
[Fri May 19 14:23:35.506693 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692]   #12 <#2> phutil_implode_html(string, array) called at [<phorge>/src/view/page/PhabricatorBarePageView.php:58]
[Fri May 19 14:23:35.506696 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692]   #13 <#2> PhabricatorBarePageView::willRenderPage() called at [<phorge>/src/view/page/PhabricatorStandardPageView.php:216]
[Fri May 19 14:23:35.506699 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692]   #14 <#2> PhabricatorStandardPageView::willRenderPage() called at [<phorge>/src/view/page/AphrontPageView.php:46]
[Fri May 19 14:23:35.506701 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692]   #15 <#2> AphrontPageView::render() called at [<phorge>/src/view/page/PhabricatorStandardPageView.php:904]
[Fri May 19 14:23:35.506704 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692]   #16 <#2> PhabricatorStandardPageView::produceAphrontResponse() called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:722]
[Fri May 19 14:23:35.506707 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692]   #17 <#2> AphrontApplicationConfiguration::produceResponse(AphrontRequest, PhabricatorStandardPageView) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:299]
[Fri May 19 14:23:35.506709 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692]   #18 phlog(InvalidArgumentException) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
[Fri May 19 14:23:35.506712 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692]   #19 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, InvalidArgumentException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
[Fri May 19 14:23:35.506717 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692]   #20 AphrontApplicationConfiguration::handleThrowable(InvalidArgumentException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:337]
[Fri May 19 14:23:35.506720 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692]   #21 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:204]
[Fri May 19 14:23:35.506723 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692]   #22 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

The problem was caused by the following line, since apparently the caption can also be not just a string:

if (phutil_nonempty_string($this->getCaption())) {

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.