Skip to content
Snippets Groups Projects
Commit f4136854 authored by Björn Schießle's avatar Björn Schießle
Browse files

stripsplashes doesn't work if the slash is the only character -> creating file...

stripsplashes doesn't work if the slash is the only character -> creating file in root dir leads to "//filename"
parent a611ce4f
No related branches found
No related tags found
No related merge requests found
...@@ -8,12 +8,11 @@ if(!OC_User::isLoggedIn()) { ...@@ -8,12 +8,11 @@ if(!OC_User::isLoggedIn()) {
} }
session_write_close(); session_write_close();
// Get the params // Get the params
$dir = isset( $_REQUEST['dir'] ) ? stripslashes($_REQUEST['dir']) : ''; $dir = isset( $_REQUEST['dir'] ) ? trim($_REQUEST['dir'], '/\\') : '';
$filename = isset( $_REQUEST['filename'] ) ? stripslashes($_REQUEST['filename']) : ''; $filename = isset( $_REQUEST['filename'] ) ? trim($_REQUEST['filename'], '/\\') : '';
$content = isset( $_REQUEST['content'] ) ? $_REQUEST['content'] : ''; $content = isset( $_REQUEST['content'] ) ? $_REQUEST['content'] : '';
$source = isset( $_REQUEST['source'] ) ? stripslashes($_REQUEST['source']) : ''; $source = isset( $_REQUEST['source'] ) ? trim($_REQUEST['source'], '/\\') : '';
if($source) { if($source) {
$eventSource=new OC_EventSource(); $eventSource=new OC_EventSource();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment