diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-07-27 13:07:12 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-07-27 13:07:12 +0400 |
commit | a49eb8777b6abdfef89c9bc02393627f77f22026 (patch) | |
tree | 50f75bb7b01d806cb19b3ad401aff720ad1b0d83 /plugins | |
parent | cfd98f76f211353c7be49de59d7d628c8505c608 (diff) |
refs #5887 should fix Invalid parameter number in case pattern parameter is used to filter all websites
Diffstat (limited to 'plugins')
-rwxr-xr-x | plugins/MultiSites/API.php | 2 | ||||
-rw-r--r-- | plugins/SitesManager/API.php | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/plugins/MultiSites/API.php b/plugins/MultiSites/API.php index 3095dce6aa..fa0cf38aca 100755 --- a/plugins/MultiSites/API.php +++ b/plugins/MultiSites/API.php @@ -170,6 +170,8 @@ class API extends \Piwik\Plugin\API } // Both calls above have called Site::setSitesFromArray. We now get these sites: $sitesToProblablyAdd = Site::getSites(); + } else if (is_array($idSitesOrIdSite)) { + $sitesToProblablyAdd = APISitesManager::getInstance()->getSitesFromIds($idSitesOrIdSite); } else { $sitesToProblablyAdd = array(APISitesManager::getInstance()->getSiteFromId($idSitesOrIdSite)); } diff --git a/plugins/SitesManager/API.php b/plugins/SitesManager/API.php index 2801ba86b5..c80413b7bb 100644 --- a/plugins/SitesManager/API.php +++ b/plugins/SitesManager/API.php @@ -419,7 +419,7 @@ class API extends \Piwik\Plugin\API * @param bool $limit * @return array */ - private function getSitesFromIds($idSites, $limit = false) + public function getSitesFromIds($idSites, $limit = false) { if (count($idSites) === 0) { return array(); @@ -427,8 +427,12 @@ class API extends \Piwik\Plugin\API if ($limit) { $limit = "LIMIT " . (int)$limit; + } else { + $limit = ''; } + $idSites = array_map('intval', $idSites); + $db = Db::get(); $sites = $db->fetchAll("SELECT * FROM " . Common::prefixTable("site") . " |