Вырезание тегов из заголовка и описания при сохранении точки; Вырезание тегов при сохранении статьи

This commit is contained in:
Krivchikov Dmitry 2015-09-11 15:16:37 +03:00
parent 2af45127b8
commit a08f5ca858
2 changed files with 9 additions and 1 deletions

View File

@ -74,7 +74,7 @@ class ArticlesController extends Controller
} }
$id = (int) $_POST['id']; $id = (int) $_POST['id'];
$title = $_POST['title']; $title = strip_tags($_POST['title']);
$text = str_replace(array('<','>'), array('&lt;','&gt;'), $_POST['text']); $text = str_replace(array('<','>'), array('&lt;','&gt;'), $_POST['text']);
$html = strip_tags($_POST['text']); $html = strip_tags($_POST['text']);

View File

@ -186,6 +186,14 @@ class JsonController extends Controller
App::redirect('/?point=' . $id); App::redirect('/?point=' . $id);
} }
if (isset($_POST['name'])) {
$_POST['name'] = strip_tags($_POST['name']);
}
if (isset($_POST['description'])) {
$_POST['description'] = strip_tags($_POST['description']);
}
if (!( isset($_POST['name']) && $_POST['name'] && strlen($_POST['name']) > 1 )) if (!( isset($_POST['name']) && $_POST['name'] && strlen($_POST['name']) > 1 ))
$errors[1] = 'Неверное название точки'; $errors[1] = 'Неверное название точки';
if (!( isset($_POST['img']) && (int) $_POST['img'])) if (!( isset($_POST['img']) && (int) $_POST['img']))