From 32ce0d3c6eb7873b3bdec424f9aefa9ec4ab3d40 Mon Sep 17 00:00:00 2001 From: Tom Needham Date: Mon, 3 Oct 2011 23:28:47 +0100 Subject: Fixed file saving issue. --- apps/files_texteditor/ajax/loadfile.php | 40 +++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 apps/files_texteditor/ajax/loadfile.php (limited to 'apps/files_texteditor/ajax/loadfile.php') 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 -- cgit v1.2.3