Allow either subdir.html or subdir/index.html, preventing edit from creating
conforming duplicates.
Reported-by: Arie van Marion
init: function(editor) {
editor.addCommand( 'inlinesave', {
exec: function (editor) {
- var pagename = window.location.pathname.replace(/\/$/, '/index');
+ var pagename = window.location.pathname;
var body = editor.getData();
// empty line is equivalent to a paragraph break
body = body.replace(/<br \/>\s*<br \/>/g, '<p>');
if (!$Args)
abort("geen bestand aangeleverd", '409 input error');
-$filename = ltrim($Args, '/').'.html';
+$filename = trim($Args, '/');
if (preg_match('{^\.}', $filename))
abort("ongeldige bestandsnaam: $filename", '403 input error');
+if (is_dir($filename) && !file_exists("$filename.html"))
+ $filename .= '/index';
+$filename .= '.html';
if (file_exists($filename) and !is_writable($filename))
abort("onwijzigbaar bestand: $filename", '403 input error');