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 Bug Fixes
Author Message
steve_lemaster
Worker
Worker



Joined: Dec 26, 2006
Posts: 178

PostPosted: Mon Mar 26, 2007 9:35 pm Reply with quote

Can anyone tell me why forumsbackend.php displays a "Internet Explorer cannot display this feed"?

Watch it be something I am probably already staring at Mr. Green
 
View user's profile Send private message Send e-mail
jjh221
Worker
Worker



Joined: Dec 05, 2006
Posts: 180

PostPosted: Tue Mar 27, 2007 2:29 am Reply with quote

huh?
 
View user's profile Send private message
steve_lemaster







PostPosted: Tue Mar 27, 2007 2:35 am Reply with quote

When I enter my url to my forumsbackend.php, it displays a "Internet Explorer cannot display this feed" page.
 
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Tue Mar 27, 2007 6:45 am Reply with quote

Use FireFox to open the same forum and you might actually get the error message. Man I hate MS... Sad

I suspect that there is something in your forum data causing issues, but we need to see the error to debug.

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
steve_lemaster







PostPosted: Tue Mar 27, 2007 10:39 am Reply with quote

Ok. Give me a minute.

The backend.php on my site works fine in M$
 
steve_lemaster







PostPosted: Tue Mar 27, 2007 10:44 am Reply with quote

montego

My forumsbackend in FireFox shows up blank.
 
montego







PostPosted: Wed Mar 28, 2007 6:17 am Reply with quote

I have to admit that I am a bit confused over these conflicting posts:

steve_lemaster wrote:
When I enter my url to my forumsbackend.php, it displays a "Internet Explorer cannot display this feed" page.


and

Quote:
Ok. Give me a minute.

The backend.php on my site works fine in M$


But, I am not sure why I did not think of this sooner (sorry), but maybe try using a RSS validator, such as [ Only registered users can see links on this board! Get registered or login! ]
 
steve_lemaster







PostPosted: Wed Mar 28, 2007 8:38 am Reply with quote

montego wrote:
I have to admit that I am a bit confused over these conflicting posts:

steve_lemaster wrote:
When I enter my url to my forumsbackend.php, it displays a "Internet Explorer cannot display this feed" page.


and

Quote:
Ok. Give me a minute.

The backend.php on my site works fine in M$


But, I am not sure why I did not think of this sooner (sorry), but maybe try using a RSS validator, such as [ Only registered users can see links on this board! Get registered or login! ]


Don't understand the confusion, but anyway this is what i got.

column 66: XML parsing error: <unknown>:41:66: not well-formed (invalid token)

<title>Is the earth still recovering from the "little ice age&</title>


I fixed it, but apparently there are a host of other characters that the feed validator doesn't like. Oh well.
 
montego







PostPosted: Wed Mar 28, 2007 9:07 am Reply with quote

Confusion for me is that in the one post it references "internet Explorer" as not being able to read the feed and then in your other post you say it "works fine in M$"... never mind. It is not important.

Now we are on to something here with that clear error message. Thanks for posting that. I will have to open an issue on this as it is happening because of the chopping off of the &quot; character at the end. I have seen this happen before with another tool too.

Thanks for pointing this out.

The solution, everyone, is to either remove the double quotes in the forum TOPIC title. This is only an interim solution until we get a fix.
 
steve_lemaster







PostPosted: Wed Mar 28, 2007 9:55 am Reply with quote

montego wrote:
Confusion for me is that in the one post it references "internet Explorer" as not being able to read the feed and then in your other post you say it "works fine in M$"... never mind. It is not important.

Now we are on to something here with that clear error message. Thanks for posting that. I will have to open an issue on this as it is happening because of the chopping off of the &quot; character at the end. I have seen this happen before with another tool too.

Thanks for pointing this out.

The solution, everyone, is to either remove the double quotes in the forum TOPIC title. This is only an interim solution until we get a fix.


Understandable.

As you know there is the backend.php for the latest news feeds and there is the forumsbackend.php for the latest forum posts. Both FF and M$ can read the feed on the backend.php, however, they are having problems reading the forums feed.

Does that help? Now that you have cleared up the reason why, I can edit the topics in my forums Smile
 
montego







PostPosted: Wed Mar 28, 2007 10:26 am Reply with quote

Actually, I think I have a fix for this. Try replacing this:

return preg_replace(
'/&[A-Za-z]+;/',
' ',
strtr($string,$entity_to_decimal) );


With:

return preg_replace('/&([A-Za-z])/', '&\\1', strtr($string, $entity_to_decimal));

In my way of thinking, we have already converted all the entities that we care to convert and then what would it hurt to take any remaining "&" out there and just represent the "&" with its decimal equivalent.

If anyone can see a security risk with this please pipe up! Thanks!

Edited: Sorry, I already had changed the code to bring everything up on one line. I have modified this post back to what it should be in your forumsbackend.php
 
steve_lemaster







PostPosted: Wed Mar 28, 2007 10:31 am Reply with quote

Thanks!

Quote:
If anyone can see a security risk with this please pipe up! Thanks!


Sorry, I can't help you there. I'm still too much of a noob to know better Very Happy
 
steve_lemaster







PostPosted: Wed Mar 28, 2007 10:37 am Reply with quote

montego wrote:
Actually, I think I have a fix for this. Try replacing this:

return preg_replace(
'/&[A-Za-z]+;/',
' ',
strtr($string,$entity_to_decimal) );


With:

return preg_replace('/&([A-Za-z])/', '&\\1', strtr($string, $entity_to_decimal));

In my way of thinking, we have already converted all the entities that we care to convert and then what would it hurt to take any remaining "&" out there and just represent the "&" with its decimal equivalent.

If anyone can see a security risk with this please pipe up! Thanks!

Edited: Sorry, I already had changed the code to bring everything up on one line. I have modified this post back to what it should be in your forumsbackend.php


That worked worship
 
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Sun Apr 01, 2007 11:25 am Reply with quote

This is really odd as it validates at [ Only registered users can see links on this board! Get registered or login! ]

I also have checked the XML it for well-formness at [ Only registered users can see links on this board! Get registered or login! ] and it validates.

I'm thinking more along the line that it may be the xml parser that you are using. Have you tried other parsers?
 
View user's profile Send private message
montego







PostPosted: Sun Apr 01, 2007 11:58 am Reply with quote

Raven, to summarize the issue, it is caused by data. It can happen with Forums and News when the data is written to the database, if its htmlentitied (as phpBB appears to be doing), if the titles are long, they can get chopped off, leaving an "&" in the title without being a valid entity (so its not converted to its decimal equivalent).

For example, something like this entered into phpBB:

This is an example of a longer title, but do not "get hung up" on the exact length

In bbtopics, the title may end up as:

This is an example of a longer title, but do not &quot;get hung up&q

So, when forumsbackend.php picks this up, the first entity is handled properly, but the one that is "chopped off" is not.

Rather than trying to modify core phpBB and nuke, I put forth a fix to at least ensure the XML will end up being valid. To be honest, this is a 1% or less issue as the combination of long titles and quotes is a small percentage combination, hence why I decided to post a fix to the RSS feeds rather than trying to chase down how to keep the data from doing getting this way in the first place.

Priorities...
 
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 Bug Fixes

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 ©