Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Do no reinvent dibi (use (%s))
Browse files Browse the repository at this point in the history
Signed-off-by: Etienne CHAMPETIER <etienne.champetier@fiducial.net>
  • Loading branch information
Etienne CHAMPETIER committed Oct 7, 2013
1 parent 18d1479 commit dbdd9a3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions core/src/plugins/conf.sql/class.sqlConfDriver.php
Expand Up @@ -200,13 +200,12 @@ public function listRepositories($user = null)
$acls = $user->mergedRole->listAcls();
$limitRepositories = array_keys($acls);
if(!count($limitRepositories)) return array();
foreach($limitRepositories as $i => $k) $limitRepositories[$i] = "'$k'";
$query = 'SELECT * FROM [ajxp_repo] WHERE uuid IN ('.implode(",",$limitRepositories).') ORDER BY [display] ASC';
// we use (%s) instead of %in to pass int as string ('1' instead of 1)
$res = dibi::query('SELECT * FROM [ajxp_repo] WHERE [uuid] IN (%s) ORDER BY [display] ASC', $limitRepositories);
} else {
$query = 'SELECT * FROM [ajxp_repo] ORDER BY [display] ASC';
$res = dibi::query('SELECT * FROM [ajxp_repo] ORDER BY [display] ASC');
}

$res = dibi::query($query);
$all = $res->fetchAll();

$repositories = Array();
Expand Down

0 comments on commit dbdd9a3

Please sign in to comment.