Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

trying to make characters safe for my RSS feed

 
   Database Forums (Home) -> PHP RSS
Next:  CDATA and SQL Server 2005  
Author Message
lkrubner

External


Since: Dec 02, 2004
Posts: 13



(Msg. 1) Posted: Mon Oct 10, 2005 3:09 pm
Post subject: trying to make characters safe for my RSS feed
Archived from groups: comp>lang>php (more info?)

Whenever users write a post in Microsoft Word and then post it to
their weblogs using my PHP software, their RSS feed ends up being
corrupted with garbage characters which violate the well-formedness of
their XML and therefore cause their newsreaders to die.

This function will probably make the character strings completely safe
for XML? I don't care about having garbage characters in the RSS feed,
I just want the RSS feed to show up, without causing anyone's newsfeed
reader to die.


function command($string=false) {
$howMany = strlen($string);

$newString = "";
for ($i=0; $i < $howMany; $i++) {
$char = $string[$i];
$asciiNum = ord($char);
if ($asciiNum > 32 && $asciiNum < 128) {
$newString .= $char;
} else {
$newString .= "'";
}
}

return $newString;
}

 >> Stay informed about: trying to make characters safe for my RSS feed 
Back to top
Login to vote
Steve222

External


Since: Sep 20, 2004
Posts: 51



(Msg. 2) Posted: Tue Oct 25, 2005 2:28 pm
Post subject: Re: trying to make characters safe for my RSS feed [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

>All the white space got replaced, but the entity that is kill the
>feed
>is still there.

â XML is not HTML.

---
Steve

 >> Stay informed about: trying to make characters safe for my RSS feed 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
question about safe - Hello! How to prevent from such try of attack of the website? http://www.example.com/index.php?id=0?;print_r(glob('*'));echo%20%22 Thank you in advance for help M.

Making eval safe? - The question in short: how do I make eval() safe? The background: At questml.com I'm offering a way to create choose- your-own-adventures in a special XML dialect. There's a several-years- old Windows-based editor for QML but I'm pondering offering a we...

Is it safe to store user_id in Session? - Dear All, What I was wondering is how safe it is to store user_id or username or anything like that in session. I usualy store a bunch of info in a session so I do not need to search the database all the time. However, is it easy to change a value after...

Is HTMLPurifier effective, safe and reliable - I am trying to find a good way to filter user input from tinyMCE, and have received advice that HTMLPurifier is a good filter for that purpose. Does anyone here have recommendations/advice?

Execution timeout workaround in a 'safe' PHP environment - Hi I have a script that processes a large number of files but the server eventually times out with a 'maximum execution time exceeded' error - after just 30 seconds. Now, the problem is, I don't have access to php.ini so I can't change anything there....
   Database Forums (Home) -> PHP All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]