Page MenuHomePhorge

5 Deprecation Notices in PhabricatorStandardPageView.php
OpenPublic

Asked by bekay on Sun, Apr 14, 08:13.

Details

preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated
arcanist(head=master, ref.master=8ef1ead6aca0), diagram(head=master, ref.master=3b52564281f2), libkids(), phorge(head=master, ref.master=c62c1087a28b)
#0 preg_match(string, NULL) called at [<phorge>/src/view/page/PhabricatorStandardPageView.php:630]
#1 PhabricatorStandardPageView::getBodyClasses() called at [<phorge>/src/view/page/AphrontPageView.php:53]
#2 AphrontPageView::render() called at [<phorge>/src/view/page/PhabricatorStandardPageView.php:919]
#3 PhabricatorStandardPageView::produceAphrontResponse() called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:722]
#4 AphrontApplicationConfiguration::produceResponse(AphrontRequest, PhabricatorStandardPageView) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:299]
#5 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
#6 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

The preg_match in lines 630, 632, 638, 640, 642 is the reason for the 5 notices (I have added only the first).

Easy fix could be to rewrite line 625:

$agent = AphrontRequest::getHTTPHeader('User-Agent') ?: '';