Jump to content

Unwanted characters in RSS


sotusotusotu

Recommended Posts

Hi guys,

 

Hopefully someone who has had this problem can answer me. I have created an small app that loops through a field in a database to show the 15 latest news stories. This all works fine and displays most of the time. The problem that I am having is that the news stories are entered through fckeditor (text editor) and this includes HTML and unwanted characters. strip_tags solves most of the problems (between "<" and ">" tags), however I am still getting things like " in my RSS feed and it is throwing it.

 

Does anyone have any ideas?

 

<?php	
while ($value = mysql_fetch_array($result)){
		echo "<item>";
			echo "<title>".strip_tags(stripslashes(clean_up_text($value['headline'])))."</title>";
			echo "<description>".strip_tags(c$value['summary'])."</description>";
			echo "<link>news.php?id=".$value['article_id']."</link>";
			echo "<guid>news.php?id=".$value['article_id']."</guid>";
			echo "<pubDate>".date("r", strtotime($value["date_added"]))."</pubDate>";
		echo "</item>";
}

	echo "</channel>";
echo "</rss>";

?>

 

Thanks, Andy

Link to comment
https://forums.phpfreaks.com/topic/101717-unwanted-characters-in-rss/
Share on other sites

I'm not sure if I have explained myself properly. Or I'm not understanding your answer.

 

I am trying to create a valid RSS.  I am getting the data from a field in my db that has been written using an online text editor.  This editor is adding HTML and characters such as " in stead of "" for example.

 

My understanding of valid RSS feeds is that characters such as " are illegal and therefore make the RSS unvalid.

 

So basically I am wondering if you know a way to check data coming out of the DB so it writes it in valid RSS?

 

I hope this makes sense.

 

Cheers

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.