barbass: дополнительно кодируем комментарий для Ajax-запросов - добавлено и для…

barbass: дополнительно кодируем комментарий для Ajax-запросов - добавлено и для текста с опечаткой (eterbug #1511)
parent 91e69205
...@@ -69,8 +69,7 @@ var ETY = { ...@@ -69,8 +69,7 @@ var ETY = {
} }
//Выделенный текст //Выделенный текст
var user_comment = encodeURIComponent(document.getElementById("e_typos_comment").value); var user_comment = document.getElementById("e_typos_comment").value.trim().substr(0, 50);
user_comment = user_comment.trim().substr(0, 50);
if (user_comment == '') { if (user_comment == '') {
user_comment = ""; user_comment = "";
} }
...@@ -84,7 +83,7 @@ var ETY = { ...@@ -84,7 +83,7 @@ var ETY = {
} else { } else {
ETY.select_text = post_text; ETY.select_text = post_text;
//Ajax-запрос //Ajax-запрос
this.ajax_query(this.server_url+"?e_typos_url="+this_url+"&e_typos_comment="+user_comment+"&e_typos_error_text="+post_text); this.ajax_query(this.server_url+"?e_typos_url="+this_url+"&e_typos_comment="+encodeURIComponent(user_comment)+"&e_typos_error_text="+encodeURIComponent(post_text));
} }
}, },
......
...@@ -33,7 +33,7 @@ if (check_header() === 0 || get_ip() === 0) { ...@@ -33,7 +33,7 @@ if (check_header() === 0 || get_ip() === 0) {
} }
$url = trim(htmlspecialchars(substr($_REQUEST['e_typos_url'], 0, 300))); $url = trim(htmlspecialchars(substr($_REQUEST['e_typos_url'], 0, 300)));
$error_text = trim(htmlspecialchars(substr($_REQUEST['e_typos_error_text'], 0, 30))); $error_text = trim(htmlspecialchars(substr(rawurldecode($_REQUEST['e_typos_error_text']), 0, 30)));
if (!isset($_REQUEST['e_typos_oldbrowser'])) { if (!isset($_REQUEST['e_typos_oldbrowser'])) {
$oldbrowser = 0; $oldbrowser = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment