ソースを参照

Removing deprecated tags for xhtml and removing invalid tags from Title post.

vbracco 16 年 前
コミット
80dcdc66ba
共有2 個のファイルを変更した7 個の追加3 個の削除を含む
  1. 1 1
      admin/index.php
  2. 6 2
      classes/functions.php

+ 1 - 1
admin/index.php ファイルの表示

@@ -70,7 +70,7 @@ if ($user->isAdmin()) {
70 70
 		
71 71
 		$textile = new Textile();
72 72
 		
73
-		$_POST["title"] = $textile->TextileThis(removeBadTags($_POST["title"]));
73
+		$_POST["title"] = $textile->TextileThis(removeBadTags($_POST["title"],true));
74 74
 		$_POST["description"] = $textile->TextileThis(removeBadTags($_POST["description"]));
75 75
 		
76 76
 		if (isset($_POST["id_post"])) {

+ 6 - 2
classes/functions.php ファイルの表示

@@ -395,8 +395,12 @@ if(!defined('entry') || !entry) die('Not a valid page');
395 395
  		return $dirs;
396 396
  	}
397 397
 
398
-	function removeBadTags($source) {
399
-		$validTags ='<p><ol><ul><li><a><abbr><acronym><blockquote><code><pre><em><i><strike><s><strong><b><br><span><div><img>';
398
+	function removeBadTags($source,$secure=false) {
399
+		if($secure){
400
+			$validTags ='<abbr><acronym><em><i><strong><b><span>';
401
+		} else {
402
+			$validTags ='<p><ol><ul><li><a><abbr><acronym><blockquote><code><pre><em><i><strong><b><br><span><div><img>';
403
+		}
400 404
 		$source = strip_tags($source, $validTags);
401 405
 		return preg_replace('/<(.*?)>/ie', "'<'.removeBadAtributes('\\1').'>'", $source);
402 406
 	}