Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> RN v2.10.01 - All Issues
Author Message
p17blo
Regular
Regular



Joined: Jul 27, 2007
Posts: 77

PostPosted: Wed Aug 22, 2007 2:22 pm Reply with quote

In my final testing I believe I have founf a problem with backend.php

It maybe to do with the content of my news items but now when backend.php is called I end up with:

A Blank Feed Page when called from Firefox
An error as follows when called from IE7
"Internet Explorer cannot display this feed

This feed contains code errors. "

If I replace the file with the backend.php from NSN News then the RSS feed displays (albeit the links don't work due to the reworking in NSN News - I haven't installed the NSN News mod)

Now it gets really interesting.
If I replace backend.php with the PHP-NUKE dist file then it works fine with Firefox and I get the following error with IE7
"Internet Explorer cannot display this feed

Internet Explorer does not support feeds with DTDs. "

Anyway, I can fix the issue by modifying the NSN file, but the RN dist file has a lot of mods in it. I will see if I can track down where the problem is and post an update, but if anyone else has any ideas let me know

Paul
 
View user's profile Send private message
p17blo







PostPosted: Wed Aug 22, 2007 3:23 pm Reply with quote

Well here is my update on a resolution - According to feedvalidator.org my RN backend.php produces an RSS Feed that is
Quote:

Message

XML Parsing error: syntax error
Explanation

Your feed is not well formed according to the XML specification. All feeds should be well-formed XML.
Solution

The text of the error may contain additional helpful details. At a minimum, the actual line and column number where the error was detected will be reported.

The most common cause is encoding errors. There are several basic approaches to solving this: escaping problematic characters, escaping entire blocks of text with CDATA sections, or putting an encoding declaration at the start of the feed.

Another common error is the inclusion of whitespace characters (spaces, tabs, newlines) before the XML Declaration. If an XML Declaration is included, it must be the first thing in the document


The error points to a <title> line with an unmodified & symbol.

Paul
 
Gremmie
Former Moderator in Good Standing



Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA

PostPosted: Wed Aug 22, 2007 3:29 pm Reply with quote

There are problems with the current implementation of backend.php and htmlentities. A better RSS feed generator is in the works.

_________________
Only registered users can see links on this board! Get registered or login! - An Event Calendar for PHP-Nuke
Only registered users can see links on this board! Get registered or login! - A Google Maps Nuke Module 
View user's profile Send private message
p17blo







PostPosted: Wed Aug 22, 2007 3:32 pm Reply with quote

Well sure enough, when I remove the & from the offending news item backend.php from RN works fine.
I can use a modified script for now and wait for the mentioned generator.

Paul
 
p17blo







PostPosted: Thu Aug 23, 2007 10:15 am Reply with quote

OK, well I have a fix for the problem.
Open backend.php

Find:
Code:


    $title = entity_to_decimal_value(str_replace('_',' ',$title)); //added 9/1/2004

Add After
Code:


    $title = preg_replace('/&(?!#[0-9]+;)/si', 'and', $title); //added 8/23/2007


This add MUST come after the first otherwise it all goes very wrong!

I have also created a new backend.php file, would anyone from RN like me to send it to them for consideration for the next release?

Paul
 
Gremmie







PostPosted: Thu Aug 23, 2007 10:41 am Reply with quote

But that replaces every entity with 'and'.....? There is already a conversion table in backend.php. You just have to run more stuff (like the title) through it.

IMHO, we need to stop storing htmlentitized text in the database. Just store plain text. And then format the text for the intended target, whether it is the screen or RSS feed, or whatever. Because they all can have different requirements.
 
p17blo







PostPosted: Thu Aug 23, 2007 11:31 am Reply with quote

Gremmie wrote:
But that replaces every entity with 'and'.....? There is already a conversion table in backend.php. You just have to run more stuff (like the title) through it.


No it doesn't. That is why it is important to add it AFTER the existing conversion. The existing conversion converts entities to something else (I thing hex or dec or something). The only thing that is left after that conversion seems the be the single AMPERSAND (not the &amp;) and the code I have added sweeps that up. Try it for yourself, it works believe me I have trying to fool it all afternoon

EDIT to add:- The title is already run through the converter, shown above!

Quote:

IMHO, we need to stop storing htmlentitized text in the database. Just store plain text. And then format the text for the intended target, whether it is the screen or RSS feed, or whatever. Because they all can have different requirements.


I agree with you on that. Store it in a unversal format in the DB then you can display it however it needs displaying.

For the moment though one line addition solves the immediate problem.

Paul
 
Gremmie







PostPosted: Thu Aug 23, 2007 11:37 am Reply with quote

Gotcha.

I'm still confused as to why XML doesn't like &amp; or any &#ddd;.
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> RN v2.10.01 - All Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot 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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©