prevent creating files with a / the name
This commit is contained in:
parent
3a5076d646
commit
063c9accb6
|
@ -15,6 +15,10 @@ if($filename == '') {
|
|||
OCP\JSON::error(array("data" => array( "message" => "Empty Filename" )));
|
||||
exit();
|
||||
}
|
||||
if(strpos($filename,'/')!==false){
|
||||
OCP\JSON::error(array("data" => array( "message" => "Invalid Filename" )));
|
||||
exit();
|
||||
}
|
||||
|
||||
if($source){
|
||||
if(substr($source,0,8)!='https://' and substr($source,0,7)!='http://'){
|
||||
|
|
|
@ -13,6 +13,10 @@ if(trim($foldername) == '') {
|
|||
OCP\JSON::error(array("data" => array( "message" => "Empty Foldername" )));
|
||||
exit();
|
||||
}
|
||||
if(strpos($filename,'/')!==false){
|
||||
OCP\JSON::error(array("data" => array( "message" => "Invalid Foldername" )));
|
||||
exit();
|
||||
}
|
||||
|
||||
if(OC_Files::newFile($dir, stripslashes($foldername), 'dir')) {
|
||||
OCP\JSON::success(array("data" => array()));
|
||||
|
|
|
@ -448,6 +448,11 @@ $(document).ready(function() {
|
|||
input.focus();
|
||||
input.change(function(){
|
||||
var name=$(this).val();
|
||||
if(name.indexOf('/')!=-1){
|
||||
$('#notification').text(t('files','Invalid name, \'/\' is not allowed.'));
|
||||
$('#notification').fadeIn();
|
||||
return;
|
||||
}
|
||||
switch(type){
|
||||
case 'file':
|
||||
$.post(
|
||||
|
|
Loading…
Reference in New Issue