Skip to content

Commit

Permalink
Fix VoteSite caching
Browse files Browse the repository at this point in the history
Codacy identified an unused local variable `$allSites` in the function
`VoteSite::getAllSites`. This was supposed to be `$ALL_SITES`, and so
the intended caching was not working.

The effect of not caching here is very minimal, since there are no
database queries involved.
  • Loading branch information
hemberger committed Oct 16, 2019
1 parent f21ab59 commit 2dd3602
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Default/VoteSite.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private static function getAllSiteData() {

public static function getAllSites() {
static $ALL_SITES;
if (!isset($allSites)) {
if (!isset($ALL_SITES)) {
$ALL_SITES = array(); // ensure this is set
foreach (self::getAllSiteData() as $linkID => $siteData) {
$ALL_SITES[$linkID] = new VoteSite($linkID, $siteData);
Expand Down

0 comments on commit 2dd3602

Please sign in to comment.