diff options
author | mcrane <mctch@yahoo.com> | 2009-06-27 21:14:19 -0600 |
---|---|---|
committer | mcrane <mctch@yahoo.com> | 2009-06-27 21:14:19 -0600 |
commit | df61b7b4addf5fd4474880bd8f4a28e95642a6e1 (patch) | |
tree | 73a87f134742fbf0d82452a86f91a5fce11fc36b /usr | |
parent | 65c79f555addb5aaa2491ef854561f374b2d9c18 (diff) | |
download | pfsense-df61b7b4addf5fd4474880bd8f4a28e95642a6e1.zip pfsense-df61b7b4addf5fd4474880bd8f4a28e95642a6e1.tar.gz |
Escape & and + for Diagnostics -> Edit File so that files save correctly.
Diffstat (limited to 'usr')
-rw-r--r--[-rwxr-xr-x] | usr/local/www/edit.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr/local/www/edit.php b/usr/local/www/edit.php index 32d2b2f..e820dac 100755..100644 --- a/usr/local/www/edit.php +++ b/usr/local/www/edit.php @@ -124,12 +124,15 @@ outputJavaScriptFileInline("filebrowser/browser.js"); function saveFile(file) { $("fileStatus").innerHTML = "Saving file ..."; Effect.Appear("fileStatusBox", { duration: 0.5 }); - + + var fileContent = escape($("fileContent").value); + fileContent = fileContent.replace(/\+/g,"%2B"); + new Ajax.Request( "<?=$_SERVER['SCRIPT_NAME'];?>", { method: "post", postBody: "action=save&file=" + $("fbTarget").value + - "&data=" + $("fileContent").value, + "&data=" + fileContent, onComplete: function(req) { var values = req.responseText.split("|"); $("fileStatus").innerHTML = values[1]; |