diff options
author | Matthieu Aubry <mattab@users.noreply.github.com> | 2016-12-27 06:18:11 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-27 06:18:11 +0300 |
commit | 6adf55495f00b75fc88bbcac3d4cae687e1039d1 (patch) | |
tree | 8e89347ba1274204acb65fe3d39974d189d9480a | |
parent | fe904148aa813519f3dfea691492ea6eb479a42d (diff) |
fix WARNING: /home/piwik/htdocs/plugins/Referrers/Controller.php(422) Warning - Invalid argument supplied for foreach() (#11098)
Reported in https://forum.piwik.org/t/warning-message-plugins-referrers-controller-php-422-warning/22314
-rw-r--r-- | plugins/Referrers/Controller.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/Referrers/Controller.php b/plugins/Referrers/Controller.php index 4554acd35a..7f3d2079cb 100644 --- a/plugins/Referrers/Controller.php +++ b/plugins/Referrers/Controller.php @@ -410,7 +410,7 @@ function DisplayTopKeywords($url = "") $api = $api . "&url=" . urlencode($url); $keywords = @json_decode(file_get_contents($api), $assoc = true); Common::sendHeader('Content-Type: text/html; charset=utf-8', true); - if ($keywords === false || isset($keywords["result"])) { + if ($keywords === false || isset($keywords["result"]) || !is_array($keywords)) { // DEBUG ONLY: uncomment for troubleshooting an empty output (the URL output reveals the token_auth) //echo "Error while fetching the <a href=\'".$api."\'>Top Keywords from Piwik</a>"; return; |