summaryrefslogtreecommitdiffstats
path: root/usr/local/www/edit.php
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-08-31 15:34:27 +0000
committerErmal <eri@pfsense.org>2010-08-31 15:34:27 +0000
commitc13b0b3103086aba66c78332c0ad9ff0d0c43f7e (patch)
treeb3ed6ccb68f5032dca289b63e25684701b2bd2a5 /usr/local/www/edit.php
parent4f1bace50d1cdaf2ae8a056f09cd40dd71c74f4e (diff)
downloadpfsense-c13b0b3103086aba66c78332c0ad9ff0d0c43f7e.zip
pfsense-c13b0b3103086aba66c78332c0ad9ff0d0c43f7e.tar.gz
Ticket #777. Use Base64 encoding for file content so javascript/php does not get confused!
Diffstat (limited to 'usr/local/www/edit.php')
-rw-r--r--usr/local/www/edit.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr/local/www/edit.php b/usr/local/www/edit.php
index 6b71ad2..9236c3f 100644
--- a/usr/local/www/edit.php
+++ b/usr/local/www/edit.php
@@ -1,5 +1,4 @@
<?php
-/* $Id$ */
/*
edit.php
Copyright (C) 2004, 2005 Scott Ullrich
@@ -56,7 +55,7 @@ if($_REQUEST['action']) {
echo "|" . gettext("No file name specified") . ".|";
} else {
conf_mount_rw();
- $_REQUEST['data'] = str_replace("\r", "", $_REQUEST['data']);
+ $_REQUEST['data'] = str_replace("\r", "", base64_decode($_REQUEST['data']));
$ret = file_put_contents($_REQUEST['file'], $_REQUEST['data']);
conf_mount_ro();
if($_REQUEST['file'] == "config.xml")
@@ -78,6 +77,7 @@ if($_REQUEST['action']) {
require("head.inc");
outputCSSFileInline("code-syntax-highlighter/SyntaxHighlighter.css");
outputJavaScriptFileInline("filebrowser/browser.js");
+outputJavaScriptFileInline("javascript/base64.js");
?>
@@ -131,7 +131,7 @@ outputJavaScriptFileInline("filebrowser/browser.js");
$("fileStatus").innerHTML = "<?=gettext("Saving file"); ?> ...";
Effect.Appear("fileStatusBox", { duration: 0.5 });
- var fileContent = escape($("fileContent").value);
+ var fileContent = Base64.encode($("fileContent").value);
fileContent = fileContent.replace(/\+/g,"%2B");
new Ajax.Request(
OpenPOWER on IntegriCloud