File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change 2929use OCA \DAV \Connector \Sabre \Exception \PasswordLoginForbidden ;
3030use OCP \Files \StorageNotAvailableException ;
3131use OCP \ILogger ;
32+ use Sabre \DAV \Exception \Conflict ;
3233use Sabre \DAV \Exception \Forbidden ;
3334use Sabre \DAV \Exception \InvalidSyncToken ;
3435use Sabre \DAV \Exception \NotAuthenticated ;
@@ -61,6 +62,9 @@ class ExceptionLoggerPlugin extends \Sabre\DAV\ServerPlugin {
6162 // happens if some a client uses the wrong method for a given URL
6263 // the error message itself is visible on the client side anyways
6364 NotImplemented::class => true ,
65+ // happens when the parent directory is not present (for example when a
66+ // move is done to a non-existent directory)
67+ Conflict::class => true ,
6468 ];
6569
6670 /** @var string */
Original file line number Diff line number Diff line change 128128 throw t ( 'files' , '"{name}" is an invalid file name.' , { name : name } ) ;
129129 } else if ( trimmedName . length === 0 ) {
130130 throw t ( 'files' , 'File name cannot be empty.' ) ;
131+ } else if ( trimmedName . indexOf ( '/' ) !== - 1 ) {
132+ throw t ( 'files' , '"/" is not allowed inside a file name.' ) ;
131133 } else if ( OC . fileIsBlacklisted ( trimmedName ) ) {
132134 throw t ( 'files' , '"{name}" is not an allowed filetype' , { name : name } ) ;
133135 }
You can’t perform that action at this time.
0 commit comments