Fix saving with apostrophes

This commit is contained in:
james 2009-10-15 21:58:51 +00:00
parent 566ae2d67f
commit b2e7797a24

View File

@ -129,11 +129,11 @@ case 'dialog_choose':
case 'email_save': case 'email_save':
print_r($_POST); print_r($_POST);
$id = intval($_POST['emails_id']); $id = intval($_POST['emails_id']);
$name = mysql_real_escape_string($_POST['name']); $name = mysql_real_escape_string(stripslashes($_POST['name']));
$description = mysql_real_escape_string($_POST['description']); $description = mysql_real_escape_string(stripslashes($_POST['description']));
$from = mysql_real_escape_string($_POST['from']); $from = mysql_real_escape_string(stripslashes($_POST['from']));
$subject = mysql_real_escape_string($_POST['subject']); $subject = mysql_real_escape_string(stripslashes($_POST['subject']));
$bodyhtml = mysql_real_escape_string($_POST['bodyhtml']); $bodyhtml = mysql_real_escape_string(stripslashes($_POST['bodyhtml']));
$type = mysql_real_escape_string($_POST['type']); $type = mysql_real_escape_string($_POST['type']);
$key = mysql_real_escape_string($_POST['key']); $key = mysql_real_escape_string($_POST['key']);
$fcid = mysql_real_escape_string($_POST['fcid']); $fcid = mysql_real_escape_string($_POST['fcid']);
@ -229,7 +229,7 @@ case 'dialog_edit':
<td colspan="2" class="input"> <td colspan="2" class="input">
<table width="100%"><tr><td width="85%"> <table width="100%"><tr><td width="85%">
<div id="fck"> <div id="fck">
<textarea id="bodyhtml" name="bodyhtml" rows=6 cols=80><?=$bodyhtml?>hi</textarea> <textarea id="bodyhtml" name="bodyhtml" rows=6 cols=80><?=$bodyhtml?></textarea>
</div> </div>
</td><td width="15%"> </td><td width="15%">
<select name="insert_field" size="20" style="height:300" > <select name="insert_field" size="20" style="height:300" >
@ -253,6 +253,9 @@ case 'dialog_edit':
<script type="text/javascript"> <script type="text/javascript">
var comm_dialog_edit_saved = false; var comm_dialog_edit_saved = false;
$("#comm_dialog_edit_save_button").click(function () { $("#comm_dialog_edit_save_button").click(function () {
var oFCKeditor = FCKeditorAPI.GetInstance('bodyhtml') ;
var value = oFCKeditor.GetHTML();
$('#bodyhtml').val(value);
$("#debug").load("<?=$config['SFIABDIRECTORY']?>/admin/communication.php?action=email_save", $("#comm_dialog_edit_form").serializeArray(), $("#debug").load("<?=$config['SFIABDIRECTORY']?>/admin/communication.php?action=email_save", $("#comm_dialog_edit_form").serializeArray(),
function() { function() {
comm_dialog_edit_saved = true; comm_dialog_edit_saved = true;
@ -294,9 +297,8 @@ case 'dialog_edit':
oFCKeditor.ToolbarSet = 'sfiab'; oFCKeditor.ToolbarSet = 'sfiab';
oFCKeditor.Width="100%"; oFCKeditor.Width="100%";
oFCKeditor.Height=300; oFCKeditor.Height=300;
$('#fck').html(oFCKeditor.CreateHtml()); // $('#fck').html(oFCKeditor.CreateHtml());
// oFCKeditor.ReplaceTextarea() ; oFCKeditor.ReplaceTextarea() ;
</script> </script>
<? <?
exit; exit;