Removing deprecated tags for xhtml and removing invalid tags from Title post.
parent
0f7c6e546b
commit
80dcdc66ba
|
|
@ -70,7 +70,7 @@ if ($user->isAdmin()) {
|
|||
|
||||
$textile = new Textile();
|
||||
|
||||
$_POST["title"] = $textile->TextileThis(removeBadTags($_POST["title"]));
|
||||
$_POST["title"] = $textile->TextileThis(removeBadTags($_POST["title"],true));
|
||||
$_POST["description"] = $textile->TextileThis(removeBadTags($_POST["description"]));
|
||||
|
||||
if (isset($_POST["id_post"])) {
|
||||
|
|
|
|||
|
|
@ -395,8 +395,12 @@ if(!defined('entry') || !entry) die('Not a valid page');
|
|||
return $dirs;
|
||||
}
|
||||
|
||||
function removeBadTags($source) {
|
||||
$validTags ='<p><ol><ul><li><a><abbr><acronym><blockquote><code><pre><em><i><strike><s><strong><b><br><span><div><img>';
|
||||
function removeBadTags($source,$secure=false) {
|
||||
if($secure){
|
||||
$validTags ='<abbr><acronym><em><i><strong><b><span>';
|
||||
} else {
|
||||
$validTags ='<p><ol><ul><li><a><abbr><acronym><blockquote><code><pre><em><i><strong><b><br><span><div><img>';
|
||||
}
|
||||
$source = strip_tags($source, $validTags);
|
||||
return preg_replace('/<(.*?)>/ie', "'<'.removeBadAtributes('\\1').'>'", $source);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue