글 제목에 대한 HTML 태그 escape

This commit is contained in:
BJRambo 2015-08-19 19:51:20 +09:00 committed by bnu
parent f26f122f17
commit c93b6462bd

View file

@ -274,6 +274,7 @@ class documentController extends document
$obj->homepage = $logged_info->homepage;
}
// If the tile is empty, extract string from the contents.
$obj->title = htmlspecialchars($obj->title);
settype($obj->title, "string");
if($obj->title == '') $obj->title = cut_str(trim(strip_tags(nl2br($obj->content))),20,'...');
// If no tile extracted from the contents, leave it untitled.