mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 14:52:41 +01:00
Make src/infrastructure/javelin/markup.php phabricator_form PHP 8.1 compliant
Summary: src/infrastructure/javelin/markup.php phabricator_form() performs a strcasecmp() operation on an optional attribute withoiut checking to see if it exists first. This causes an 'Passing null to parameter #1 ($string1) of type string is deprecated' error. Because we subsequenly check to see that the value equals /POST/i, all we need to do is check that the value has some 'true' value before doing the strcasecmp(). If it's not true, then it won't be POST! Fixes T15509 Test Plan: View a diff. Eg: https://my.phorge.site/D1234 Reviewers: O1 Blessed Committers, valerio.bozzolan Reviewed By: O1 Blessed Committers, valerio.bozzolan Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T15509 Differential Revision: https://we.phorge.it/D25319
This commit is contained in:
parent
101ce834b8
commit
73253489bf
1 changed files with 1 additions and 1 deletions
|
@ -74,7 +74,7 @@ function phabricator_form(PhabricatorUser $user, $attributes, $content) {
|
|||
$body = array();
|
||||
|
||||
$http_method = idx($attributes, 'method');
|
||||
$is_post = (strcasecmp($http_method, 'POST') === 0);
|
||||
$is_post = $http_method && (strcasecmp($http_method, 'POST') === 0);
|
||||
|
||||
$http_action = idx($attributes, 'action');
|
||||
|
||||
|
|
Loading…
Reference in a new issue