Fixed RSS Bug
I -probably- fixed the auth bug in the RSS feeds.
Alon pointed out that when using a link from an RSS feed, regardless of the entry, when the page loaded, people were always getting the 'not authorized' error. At first I thought this was an error in my mod_rewrite syntax, but I checked and double checked the rules and they were fine. I figured out that the bug was due to a short-sightedness on my part: part of the authorization stuff happens in session data. This is fine on it's own, but until you create session data, there won't be any! Duh. This was only happening on a fresh browser session - once you've visited the site at least once after opening your browser, it would go away.
The code checked to see if the authorization level set in session data was appropriate for viewing the entry with the id present in the URI. Even for Guest-level posts, the IF statement would always return false because the $_SESSION data was null. I ammended the IF statement and added an ELSEIF to catch the no-session-data AND authorization level was less than or equal to 1. Now, if you're visiting without session data and trying to get to an entry with a reading authorization less than or equal to 1(presumably from the atom feed...), you'll be fine.
Thank you Alon for pointing it out! If I had taken ten minutes earlier I could have fixed this long ago :P
comments
1
Alan
Thursday, February 8, 2007
No problem (also, your link to me in this post is relative...)