@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+1 -1
+1 -1
src/infrastructure/javelin/markup.php
··· 74 74 $body = array(); 75 75 76 76 $http_method = idx($attributes, 'method'); 77 - $is_post = (strcasecmp($http_method, 'POST') === 0); 77 + $is_post = $http_method && (strcasecmp($http_method, 'POST') === 0); 78 78 79 79 $http_action = idx($attributes, 'action'); 80 80