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

Initialize $cache_key variable in CelerityResourceController.php

Summary:
`$cache_key` is unconditionally called in `$cache->setKey($cache_key, $data)` but is only defined if the previous condition `if ($is_cacheable && $is_locally_cacheable && !$dev_mode)` was true.
Thus initialize the variable to avoid a theoretical exception. (No additional null check is needed as `$cache` gets defined in the same condition.)

Test Plan: Carefully read the code.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25642

+2 -1
+2 -1
src/applications/celerity/controller/CelerityResourceController.php
··· 59 59 } 60 60 61 61 $cache = null; 62 + $cache_key = null; 62 63 $data = null; 63 64 if ($is_cacheable && $is_locally_cacheable && !$dev_mode) { 64 65 $cache = PhabricatorCaches::getImmutableCache(); ··· 98 99 $data = $xformer->transformResource($path, $data); 99 100 } 100 101 101 - if ($cache) { 102 + if ($cache && $cache_key !== null) { 102 103 $cache->setKey($cache_key, $data); 103 104 } 104 105 }