Merge pull request #13325 from owncloud/kill-strip-slashes
Get rid of `stripslashes()`
This commit is contained in:
commit
65ee2b1de8
|
@ -6,7 +6,7 @@ OCP\JSON::callCheck();
|
||||||
|
|
||||||
|
|
||||||
// Get data
|
// Get data
|
||||||
$dir = stripslashes($_POST["dir"]);
|
$dir = isset($_POST['dir']) ? $_POST['dir'] : '';
|
||||||
$allFiles = isset($_POST["allfiles"]) ? $_POST["allfiles"] : false;
|
$allFiles = isset($_POST["allfiles"]) ? $_POST["allfiles"] : false;
|
||||||
|
|
||||||
// delete all files in dir ?
|
// delete all files in dir ?
|
||||||
|
|
|
@ -5,9 +5,9 @@ OCP\JSON::callCheck();
|
||||||
\OC::$server->getSession()->close();
|
\OC::$server->getSession()->close();
|
||||||
|
|
||||||
// Get data
|
// Get data
|
||||||
$dir = stripslashes($_POST["dir"]);
|
$dir = isset($_POST['dir']) ? $_POST['dir'] : '';
|
||||||
$file = stripslashes($_POST["file"]);
|
$file = isset($_POST['file']) ? $_POST['file'] : '';
|
||||||
$target = stripslashes(rawurldecode($_POST["target"]));
|
$target = isset($_POST['target']) ? rawurldecode($_POST['target']) : '';
|
||||||
|
|
||||||
$l = \OC::$server->getL10N('files');
|
$l = \OC::$server->getL10N('files');
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,6 @@ if (!\OC\Files\Filesystem::file_exists($dir . '/')) {
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO why is stripslashes used on foldername in newfolder.php but not here?
|
|
||||||
$target = $dir.'/'.$filename;
|
$target = $dir.'/'.$filename;
|
||||||
|
|
||||||
if (\OC\Files\Filesystem::file_exists($target)) {
|
if (\OC\Files\Filesystem::file_exists($target)) {
|
||||||
|
|
|
@ -8,8 +8,8 @@ OCP\JSON::callCheck();
|
||||||
\OC::$server->getSession()->close();
|
\OC::$server->getSession()->close();
|
||||||
|
|
||||||
// Get the params
|
// Get the params
|
||||||
$dir = isset( $_POST['dir'] ) ? stripslashes($_POST['dir']) : '';
|
$dir = isset($_POST['dir']) ? $_POST['dir'] : '';
|
||||||
$foldername = isset( $_POST['foldername'] ) ? stripslashes($_POST['foldername']) : '';
|
$foldername = isset($_POST['foldername']) ? $_POST['foldername'] : '';
|
||||||
|
|
||||||
$l10n = \OC::$server->getL10N('files');
|
$l10n = \OC::$server->getL10N('files');
|
||||||
|
|
||||||
|
|
|
@ -132,9 +132,9 @@ if (strpos($dir, '..') === false) {
|
||||||
// $path needs to be normalized - this failed within drag'n'drop upload to a sub-folder
|
// $path needs to be normalized - this failed within drag'n'drop upload to a sub-folder
|
||||||
if ($resolution === 'autorename') {
|
if ($resolution === 'autorename') {
|
||||||
// append a number in brackets like 'filename (2).ext'
|
// append a number in brackets like 'filename (2).ext'
|
||||||
$target = OCP\Files::buildNotExistingFileName(stripslashes($dir . $relativePath), $files['name'][$i]);
|
$target = OCP\Files::buildNotExistingFileName($dir . $relativePath, $files['name'][$i]);
|
||||||
} else {
|
} else {
|
||||||
$target = \OC\Files\Filesystem::normalizePath(stripslashes($dir . $relativePath).'/'.$files['name'][$i]);
|
$target = \OC\Files\Filesystem::normalizePath($dir . $relativePath.'/'.$files['name'][$i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// relative dir to return to the client
|
// relative dir to return to the client
|
||||||
|
|
Loading…
Reference in New Issue