瀏覽代碼

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
 	}