Select the correct column when searching for similar targets

This commit is contained in:
Michael Gapczynski 2012-08-06 16:48:20 -04:00
parent 5e95e2a131
commit a96a75c263

View file

@ -778,7 +778,7 @@ class Share {
if ($checkTarget = self::getItems($itemType, $target, $shareType, $shareWith, null, self::FORMAT_NONE, null, 1)) {
// Find similar targets to improve backend's chances to generate a unqiue target
// TODO query needs to be setup like getItems
$checkTargets = \OC_DB::prepare('SELECT item_target FROM *PREFIX*share WHERE item_type = ? AND share_with = ? AND '.$column.' LIKE ?');
$checkTargets = \OC_DB::prepare('SELECT '.$column.' FROM *PREFIX*share WHERE item_type = ? AND share_with = ? AND '.$column.' LIKE ?');
$result = $checkTargets->execute(array($itemType, $shareWith, '%'.$target.'%'));
while ($row = $result->fetchRow()) {
$exclude[] = $row[$column];