0
A
回答
0
<style>
標籤在文檔正文中無效。
有可能以某種方式保護它們(至少它在CKEDitor的繼任者中,請參閱here並搜索protectedSource
),但主要問題應該是:他們爲什麼在那裏?
1
作爲記錄CKEditor不是TinyMCE的繼任者,只是競爭對手。
您可以通過在TinyMCE的驗證配置中將'style'指定爲允許的標籤之一來將樣式標籤保留在內容中。只需添加:
extended_valid_elements: "style"
將您傳遞給init的配置。
0
如果您使用WYSIWYG TinyMCE或CKEditor和框架CodeIgniter版本> 2.0,則可能會遇到消除樣式屬性的問題。
您可以在提交表單後設置樣式。
這是地獄風格=「」?
也許你有這個選項在config.php文件中啓用:
$config['global_xss_filtering'] = TRUE;
禁用全局過濾後,所見即所得不輸風格。
就個人而言,我並不想禁用此功能,所以我做了一個解決方法;基於Bart的建議,不亂用核心文件
編輯O);
此安全是爲某些加入鄰)原因,所以爲了不徹底擺脫它,我創建了一個存儲標籤樣式不會被刪除的地址的數組。
您需要創建MY_Security.php文件擴展名核安全 類,並添加修改功能_remove_evil_attributes。
protected function _remove_evil_attributes($str, $is_image){
// All javascript event handlers (e.g. onload, onclick, onmouseover), style, and xmlns
$allowed = array("your allowed url's without domain like '/admin/edittext/'");
if(in_array($_SERVER['REQUEST_URI'],$allowed)){
$evil_attributes = array('on\w*', 'xmlns');
}else{
$evil_attributes = array('on\w*', 'style', 'xmlns');
}
if ($is_image === TRUE){
/*
* Adobe Photoshop puts XML metadata into JFIF images,
* including namespacing, so we have to allow this for images.
*/
unset($evil_attributes[array_search('xmlns', $evil_attributes)]);
}
do {
$str = preg_replace(
"#<(/?[^><]+?)([^A-Za-z\-])(".implode('|', $evil_attributes).")(\s*=\s*)([\"][^>]*?[\"]|[\'][^>]*?[\']|[^>]*?)([\s><])([><]*)#i",
"<$1$6",
$str, -1, $count
);
} while ($count);
return $str;
}
相關問題
- 1. TinyMce格式問題
- 2. 風格問題
- 3. 的風格問題
- 4. TinyMCE的風格衝突
- 5. Python風格問題
- 6. OOP風格問題
- 7. PHP風格問題
- 8. $ img_attributes風格問題
- 9. PHPExcel風格問題
- 10. CSS3風格問題
- 11. Winform風格問題:Windows經典風格?
- 12. AntiSamy for TinyMce風格屬性
- 13. TinyMCE的問題
- 14. IE中的風格問題
- 15. TinyMCE的HTML問題
- 16. 問題與TinyMCE的
- 17. loading TinyMCE的問題
- 18. Django TinyMCE問題
- 19. django-tinymce問題
- 20. paste_preprocess tinymce問題
- 21. Tinymce AutoResize問題
- 22. backBarButtonItem(leftbackButtonItem)風格問題
- 23. OO風格 - 簡單問題
- 24. 編碼風格有問題
- 25. 風格問題與火狐
- 26. MVC部署風格問題
- 27. 風格TargetType屬性問題
- 28. Div風格 - 問題與IE
- 29. VideoView MediaController風格問題
- 30. 問題與WPF風格