From: Tom Needham Date: Mon, 3 Oct 2011 22:28:47 +0000 (+0100) Subject: Fixed file saving issue. X-Git-Tag: v3.0~122 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=32ce0d3c6eb7873b3bdec424f9aefa9ec4ab3d40;p=nextcloud-server.git Fixed file saving issue. --- diff --git a/apps/files_texteditor/ajax/loadfile.php b/apps/files_texteditor/ajax/loadfile.php new file mode 100644 index 00000000000..b06b0fa83d2 --- /dev/null +++ b/apps/files_texteditor/ajax/loadfile.php @@ -0,0 +1,40 @@ +. + * + */ + +// Init owncloud +require_once('../../../lib/base.php'); + + +// Check if we are a user +OC_JSON::checkLoggedIn(); + +// Set the session key for the file we are about to edit. +$path = isset($_GET['path']) ? $_GET['path'] : false; + +if($path){ + $sessionname = md5('oc_file_hash_'.$path); + $filecontents = OC_Filesystem::file_get_contents($path); + OC_Filesystem::update_session_file_hash($sessionname,sha1(htmlspecialchars($filecontents))); + OC_JSON::success(); +} else { + OC_JSON::error(); +} \ No newline at end of file diff --git a/apps/files_texteditor/ajax/savefile.php b/apps/files_texteditor/ajax/savefile.php index da3599b96c6..f1a2bafc12b 100644 --- a/apps/files_texteditor/ajax/savefile.php +++ b/apps/files_texteditor/ajax/savefile.php @@ -1,6 +1,6 @@