From 90783a3ff6a8171f11f15adc7d57925548b1756f Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Mon, 10 Jul 2017 03:52:57 +0200 Subject: [PATCH] rename all html files to php Server permissions to set "AddHandler application/x-httpd-php html" may not be available. Appropriate extension should work everywhere. --- edit.js | 2 +- edit.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/edit.js b/edit.js index f7068ad..dee1038 100644 --- a/edit.js +++ b/edit.js @@ -2,7 +2,7 @@ CKEDITOR.plugins.add('inlinesave', { init: function(editor) { editor.addCommand( 'inlinesave', { exec: function (editor) { - var pagename = window.location.pathname.replace(/\.html$/, '').replace(/\/$/, '/index'); + var pagename = window.location.pathname.replace(/\.php$/, '').replace(/\/$/, '/index'); var data = 'body='+encodeURIComponent(editor.getData()); ajaxpost = new XMLHttpRequest(); ajaxpost.open('POST', '/edit.php'+pagename, true); diff --git a/edit.php b/edit.php index afa6c6d..94206bb 100755 --- a/edit.php +++ b/edit.php @@ -10,7 +10,7 @@ if (!$_POST) if (!isset($_SERVER['PATH_INFO']) or strlen($_SERVER['PATH_INFO']) <= 1) abort('409 input error', "geen bestand aangeleverd"); -$filename = preg_replace('/(?:\.html)?$/', '.html', ltrim($_SERVER['PATH_INFO'], '/'), 1); +$filename = preg_replace('/(?:\.php)?$/', '.php', ltrim($_SERVER['PATH_INFO'], '/'), 1); if (file_exists($filename) and !is_writable($filename)) abort('403 input error', "ongeldige bestandsnaam: $filename"); if (is_executable($filename)) -- 2.30.0