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:
authormattab <matthieu.aubry@gmail.com>2015-06-11 06:57:46 +0300
committermattab <matthieu.aubry@gmail.com>2015-06-11 06:57:46 +0300
commit4058aaf16a6603ab6dd9cecdf314c396b6e2eec0 (patch)
tree1b9a28e085b97d1c97ad45915ff72d0b298d9f99 /plugins/SitesManager/Model.php
parent1ab1ca62dd6f28cd0cdc63f5575cedaac6305200 (diff)
Rather than manually write SQL bind parameters, reuse Common::getSqlStringFieldsArray
Diffstat (limited to 'plugins/SitesManager/Model.php')
-rw-r--r--plugins/SitesManager/Model.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/SitesManager/Model.php b/plugins/SitesManager/Model.php
index 7be060fca1..676c5a6f12 100644
--- a/plugins/SitesManager/Model.php
+++ b/plugins/SitesManager/Model.php
@@ -113,10 +113,10 @@ class Model
$ids = $this->getDb()->fetchAll(
'SELECT idsite FROM ' . $this->table . '
- WHERE (main_url = ? OR main_url = ? OR main_url = ? OR main_url = ?) ' .
+ WHERE main_url IN ( ' . Common::getSqlStringFieldsArray($urls) . ') ' .
'UNION
SELECT idsite FROM ' . $siteUrlTable . '
- WHERE (url = ? OR url = ? OR url = ? OR url = ?) ',
+ WHERE url IN ( ' . Common::getSqlStringFieldsArray($urls) . ') ',
// Bind
array_merge( $urls, $urls)
@@ -140,12 +140,12 @@ class Model
$ids = $this->getDb()->fetchAll(
'SELECT idsite
FROM ' . $this->table . '
- WHERE (main_url = ? OR main_url = ? OR main_url = ? OR main_url = ?)' .
+ WHERE main_url IN ( ' . Common::getSqlStringFieldsArray($urls) . ')' .
'AND idsite IN (' . $sqlAccessSite . ') ' .
'UNION
SELECT idsite
FROM ' . $siteUrlTable . '
- WHERE (url = ? OR url = ? OR url = ? OR url = ?)' .
+ WHERE url IN ( ' . Common::getSqlStringFieldsArray($urls) . ')' .
'AND idsite IN (' . $sqlAccessSite . ')',
// Bind