Horse
Horse

Reputation: 3063

PHP clean RSS populated by WYSIWYG editor in CMS

So I have an RSS feed 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 :)

Upvotes: 2

Views: 337

Answers (1)

Jeff
Jeff

Reputation: 81

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

Upvotes: 1

Related Questions