@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.

Fix some PHP 7.4 array index access issues

Summary: Ref T13518. See <https://discourse.phabricator-community.org/t/more-exceptions-when-viewing-diffs/3789/>. Under PHP 7.4, accessing an array index of values like `false` and `null` is no longer valid. This is great, but we occasionally do it.

Test Plan:
- Upgraded to PHP 7.4.
- Loaded revisions with added/changed lines, inlines, and Asana support configured.
- Before patch: saw various fatals around accessing indexes of booleans and nulls.
- After patch: clean revision.

Maniphest Tasks: T13518

Differential Revision: https://secure.phabricator.com/D21172

+15
+4
src/applications/differential/customfield/DifferentialAsanaRepresentationField.php
··· 44 44 45 45 $edge = head($edges[$src_phid][$edge_type]); 46 46 47 + if (!$edge) { 48 + return null; 49 + } 50 + 47 51 if (!empty($edge['data']['gone'])) { 48 52 return phutil_tag( 49 53 'em',
+6
src/applications/differential/parser/DifferentialChangesetParser.php
··· 1326 1326 $old_back = array(); 1327 1327 $new_back = array(); 1328 1328 foreach ($this->old as $ii => $old) { 1329 + if ($old === null) { 1330 + continue; 1331 + } 1329 1332 $old_back[$old['line']] = $old['line']; 1330 1333 } 1331 1334 foreach ($this->new as $ii => $new) { 1335 + if ($new === null) { 1336 + continue; 1337 + } 1332 1338 $new_back[$new['line']] = $new['line']; 1333 1339 } 1334 1340
+5
src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php
··· 593 593 594 594 $map = array(); 595 595 foreach ($new as $offset => $new_line) { 596 + if ($new_line === null) { 597 + continue; 598 + } 599 + 596 600 if ($new_line['line'] === null) { 597 601 continue; 598 602 } 603 + 599 604 $map[$new_line['line']] = $offset; 600 605 } 601 606