From 4accdd8681e45845d045c254569258df64a1cf4e Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Tue, 15 Jul 2014 22:47:51 +0200 Subject: [PATCH] edit: rooted links to support subdirectories --- edit.js | 4 ++-- edit.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/edit.js b/edit.js index 95a512e..784e370 100644 --- a/edit.js +++ b/edit.js @@ -5,7 +5,7 @@ CKEDITOR.plugins.add('inlinesave', { var pagename = window.location.pathname.replace(/^\//, '') || 'index'; var data = 'page='+encodeURIComponent(pagename)+'&body='+encodeURIComponent(editor.getData()); ajaxpost = new XMLHttpRequest(); - ajaxpost.open('POST', 'edit.php', true); + ajaxpost.open('POST', '/edit.php', true); ajaxpost.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); ajaxpost.onreadystatechange = function () { if (ajaxpost.readyState != 4) @@ -50,7 +50,7 @@ CKEDITOR.on('instanceCreated', function (event) { ['Inlinesave', '-', 'ShowBlocks', 'Sourcedialog', '-', 'Undo', 'Redo'], ['Format'], ['BulletedList', 'NumberedList', '-', 'Blockquote'], - ['Bold', 'Italic', 'Underline', 'Strike', '-', 'Link'], + ['Bold', 'Italic', 'Underline', 'Strike', 'RemoveFormat', '-', 'Link'], ['HorizontalRule', 'Table', 'Image'], ]; diff --git a/edit.php b/edit.php index 398581e..657c279 100644 --- a/edit.php +++ b/edit.php @@ -14,8 +14,8 @@ $filename = preg_replace('/(?:\.html)?$/', '.html', ltrim($_POST['page'], '/'), if (file_exists($filename) and !is_writable($filename)) abort('403 input error', "ongeldige bestandsnaam: $filename"); -$prepend = ''."\n\n"; -$append = "\n".''."\n"; +$prepend = ''."\n\n"; +$append = "\n".''."\n"; $upload = $_POST['body']; if (!$upload) -- 2.30.0