开发者

PHP clean RSS populated by WYSIWYG editor in CMS

开发者 https://www.devze.com 2023-03-23 05:59 出处:网络
So I have an RSS feed 开发者_StackOverflow社区created by a list of blogs. every now and again someone using the WYSIWYG editor in the CMS puts in some random character and it makes the feed invalid.

So I have an RSS feed 开发者_StackOverflow社区created by a list of blogs. every now and again someone using the WYSIWYG editor in the CMS puts in some random character and it makes the feed invalid.

I have forced UTF8 encoding, and been doing string replace on the chars that slip through, but I wondered is there a nice quick and easy RSS cleaning / sanitising function that would always return valid RSS no matter what was put in?

Edit: Also a solution without using frameworks such as PEAR / Zend would be ideal :)


What kind of characters are you talking about here? Will PHP's built in htmlspecialchars() function do what you want?

See: http://php.net/manual/en/function.htmlspecialchars.php

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号