Verify if path exists
We need to check if the path exists and throw an error instead of handling this situation ungraciously.
This commit is contained in:
parent
7a0917e5b2
commit
ebb5523698
|
@ -83,6 +83,10 @@ if (empty($_POST['dirToken'])) {
|
||||||
|
|
||||||
// The token defines the target directory (security reasons)
|
// The token defines the target directory (security reasons)
|
||||||
$path = \OC\Files\Filesystem::getPath($linkItem['file_source']);
|
$path = \OC\Files\Filesystem::getPath($linkItem['file_source']);
|
||||||
|
if($path === null) {
|
||||||
|
OCP\JSON::error(array('data' => array_merge(array('message' => $l->t('Unable to set upload directory.')))));
|
||||||
|
die();
|
||||||
|
}
|
||||||
$dir = sprintf(
|
$dir = sprintf(
|
||||||
"/%s/%s",
|
"/%s/%s",
|
||||||
$path,
|
$path,
|
||||||
|
|
Loading…
Reference in New Issue