Add error handling for getSource()
This commit is contained in:
parent
e91f42d249
commit
c8781b1caf
|
@ -85,12 +85,16 @@ class OC_SHARE {
|
|||
$parts = explode("/", $target);
|
||||
$query = OC_DB::prepare("SELECT source FROM *PREFIX*sharing WHERE target = ? AND uid_shared_with = ?");
|
||||
$result = $query->execute(array($parts[0], $_SESSION['user_id']))->fetchAll();
|
||||
$source = $result[0]['source'];
|
||||
// Add the $parts back in
|
||||
foreach (array_slice($parts, 1) as $part) {
|
||||
$source .= $part;
|
||||
if (count($result) > 0) {
|
||||
$source = $result[0]['source'];
|
||||
// Add the $parts back in
|
||||
foreach (array_slice($parts, 1) as $part) {
|
||||
$source .= $part;
|
||||
}
|
||||
return $source;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return $source;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue