Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Bug in NETSCAPE caused Review.cgi Problem

Quote Reply
Bug in NETSCAPE caused Review.cgi Problem
Hi:



Just discovered a minor problem- which I beleive is caused in and/or by Netscape- that causes a 400: Bad Request error from Reviews.



The problem is that Netscape (I am testing with 4.08) does nor pass a space as a URL well. IE translates the space to a "%20" just fine, but Nescape does not. So, If a username has a space in it, when you go to a the list of reviews, Netscape craters...



Here is a sample URL:



http://www.bcdb.com/...view.cgi?user=Thad K



I added some code to login.cgi to prevent spaces in usernames.... but that does not help me with the 300+ users that HAVE a space in their names now...



dave
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] Bug in NETSCAPE caused Review.cgi Problem In reply to
If anyone wants to add code to not allow spaces (or other "whitespace" characters in a username, here is the code I use:



Quote:




if ($username =~/\s/) {

print Links::SiteHTML::display ('signup_form', { error => Links::language('USER_INVALIDNAME2', $email) });

return;

}
Just put this into Login.PM in sub signup_user just after

# Set date variable to today's date. and the date code. Then, add USER_INVALIDNAME2 to globals, with whatever text you care to add regarding not allowing spaces in usernames...




dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] Bug in NETSCAPE caused Review.cgi Problem In reply to
You could create a global to change spaces to %20 and use something like:

<%escape($Username)%>
Quote Reply
Re: [Paul] Bug in NETSCAPE caused Review.cgi Problem In reply to
Paul:



Yeah, or just run:

Quote:


UPDATE Users SET Username = REPLACE(Username, ' ', '%20')


That would fix the existing usernames, I would think.



Main thing, I just wanted to make people aware of this!




dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] Bug in NETSCAPE caused Review.cgi Problem In reply to
Nope- that does NOT work.... the %20 prints a space in the URL, still...
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] Bug in NETSCAPE caused Review.cgi Problem In reply to
watch out with that one, it changes that username so it will affect how users will have to long, as well.

So, "daniel boone" would then have to login as "daniel%20boon". To top it off, when you get the link to the user, the system will think you're trying to address "daniel boone" and will give you no hits back. Ugh, encoding schemes Tongue
Quote Reply
Re: [Aki] Bug in NETSCAPE caused Review.cgi Problem In reply to
Aki:



Yeah, seems to be more hassle than it is worth....



I may just run a similar sql statement and just REMOVE spaces, and send an e-mail to all users making them aware that "Daniel Boone" is now DanielBoone"

Anyway, I would suggest updating Login.pm so this dores not happen in the future!
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] Bug in NETSCAPE caused Review.cgi Problem In reply to
You could upgrade your browser :) ....why would you _choose_ to use NS4.08? Angelic
Quote Reply
Re: [carfac] Bug in NETSCAPE caused Review.cgi Problem In reply to
Here's the fix, Paul had the right idea:

In the file review_search_results.html found in the "default" (or whatver template set you are using) template set, you'll find:

Code:
<a href='<%db_cgi_url%>/review.cgi?user=<%Review_Owner%>'>

Change that code to

Code:
<a href='<%db_cgi_url%>/review.cgi?user=<%GT::CGI::escape( $Review_Owner )%>'>

Which should escape the name for you. Don't do it for the other instances because it'll stick escapes into basic text.
Quote Reply
Re: [Paul] Bug in NETSCAPE caused Review.cgi Problem In reply to
Paul:



I do not normally use netscape.... but I TEST with it. I have 5 browsers I test with...
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [Aki] Bug in NETSCAPE caused Review.cgi Problem In reply to
Aki:



Thanks!



It is called "escaping?" Thanks, I did not know that!



dave
dave

Big Cartoon DataBase
Big Comic Book DataBase