Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Aubry <mattab@users.noreply.github.com>2016-12-27 06:18:11 +0300
committerGitHub <noreply@github.com>2016-12-27 06:18:11 +0300
commit6adf55495f00b75fc88bbcac3d4cae687e1039d1 (patch)
tree8e89347ba1274204acb65fe3d39974d189d9480a
parentfe904148aa813519f3dfea691492ea6eb479a42d (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.php2
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;