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

parent ef545df9
...@@ -69,7 +69,8 @@ var ETY = { ...@@ -69,7 +69,8 @@ var ETY = {
} }
//Выделенный текст //Выделенный текст
var user_comment = document.getElementById("e_typos_comment").value.trim().substr(0, 50); var user_comment = encodeURIComponent(document.getElementById("e_typos_comment").value);
user_comment = user_comment.trim().substr(0, 50);
if (user_comment == '') { if (user_comment == '') {
user_comment = ""; user_comment = "";
} }
......
...@@ -29,7 +29,7 @@ if (check_header() === 0 || get_ip() === 0) { ...@@ -29,7 +29,7 @@ if (check_header() === 0 || get_ip() === 0) {
if (!isset($_REQUEST['e_typos_comment'])) { if (!isset($_REQUEST['e_typos_comment'])) {
$comment = ''; $comment = '';
} else { } else {
$comment = trim(htmlspecialchars(substr($_REQUEST['e_typos_comment'], 0, 50))); $comment = trim(htmlspecialchars(substr(rawurldecode($_REQUEST['e_typos_comment']), 0, 50)));
} }
$url = trim(htmlspecialchars(substr($_REQUEST['e_typos_url'], 0, 300))); $url = trim(htmlspecialchars(substr($_REQUEST['e_typos_url'], 0, 300)));
......
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