aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorblizzz <blizzz@owncloud.com>2012-11-12 03:37:43 -0800
committerblizzz <blizzz@owncloud.com>2012-11-12 03:37:43 -0800
commite0fdb8272beb0a0f537b9a60b8e0258a9a59c288 (patch)
treea177cea8dbe1476597be0b7af1260345c15d8362
parent09d6d843f77d397dfc90931354d3860bd7098f3e (diff)
parentba91f9a23717cef0d9dc675e47f66e303f139708 (diff)
downloadnextcloud-server-e0fdb8272beb0a0f537b9a60b8e0258a9a59c288.tar.gz
nextcloud-server-e0fdb8272beb0a0f537b9a60b8e0258a9a59c288.zip
Merge pull request #371 from butonic/sql_and_error_log_fixes
add missing sql backticks, check sharing for error and add log
-rw-r--r--lib/public/share.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/public/share.php b/lib/public/share.php
index 24de4dcd5b2..dcb1b5c278e 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -548,7 +548,7 @@ class Share {
$itemTypes = $collectionTypes;
}
$placeholders = join(',', array_fill(0, count($itemTypes), '?'));
- $where .= ' WHERE item_type IN ('.$placeholders.'))';
+ $where .= ' WHERE `item_type` IN ('.$placeholders.'))';
$queryArgs = $itemTypes;
} else {
$where = ' WHERE `item_type` = ?';
@@ -625,7 +625,7 @@ class Share {
$queryArgs[] = $item;
if ($includeCollections && $collectionTypes) {
$placeholders = join(',', array_fill(0, count($collectionTypes), '?'));
- $where .= ' OR item_type IN ('.$placeholders.'))';
+ $where .= ' OR `item_type` IN ('.$placeholders.'))';
$queryArgs = array_merge($queryArgs, $collectionTypes);
}
}
@@ -673,6 +673,9 @@ class Share {
$root = strlen($root);
$query = \OC_DB::prepare('SELECT '.$select.' FROM `*PREFIX*share` '.$where, $queryLimit);
$result = $query->execute($queryArgs);
+ if (\OC_DB::isError($result)) {
+ \OC_Log::write('OCP\Share', \OC_DB::getErrorMessage($result) . ', select=' . $select . ' where=' . $where, \OC_Log::ERROR);
+ }
$items = array();
$targets = array();
while ($row = $result->fetchRow()) {