Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 11:32 am EST
Geeklog Forums
Bug in user photo upload code?
monoclast
From line 790 of "usersettings.php":
The problem is, since the "?" character is a special reserved character in URLs, web browsers cannot display the resulting image.
Question 1: Is there a function I can call on this file name to replace restricted characters before saving the file?
Question 2: How can we make sure this is fixed in future versions of Geeklog
-mono
1000ideen
I think it is not really necessary to avoid the '?' in the username but to change it in display. If you look at this list http://www.w3schools.com/tags/ref_urlencode.asp a '?' should be '%3F' in the URL, if I understand this correctly.
Dirk
The underlying problem is that Geeklog is a bit too lax about the characters it accepts for usernames. That would be easy to fix for new sites but requires a migration strategy for existing sites.
bye, Dirk
1000ideen
Geeklog is a bit too lax about the characters it accepts for usernames.
Hm, as for me it can`t be lax enough :wink: I quite like the ability to use a name like "the three ???" or so. One also has to take into account that there are languages not using latin letters. But of course it should work propperly when showing the user pic.
monoclast
As Markus said: Submit a bug report, please. You already provided a good description of the problem - you could pretty much copy that into the bug report.
The underlying problem is that Geeklog is a bit too lax about the characters it accepts for usernames. That would be easy to fix for new sites but requires a migration strategy for existing sites.
bye, Dirk
Thank you. I have reported the bug here:
http://project.geeklog.net/tracking/view.php?id=824
I am of the opinion that punctuation characters such as "?" should be allowed in user names. The real issue, IMO, is that Geeklog isn't properly encoding the user name for inclusion in a URL when it names the image file.
monoclast
Sounds like a bug which you may report in http://project.geeklog.net/tracking/
I think it is not really necessary to avoid the '?' in the username but to change it in display. If you look at this list http://www.w3schools.com/tags/ref_urlencode.asp a '?' should be '%3F' in the URL, if I understand this correctly.
Right. Thanks.
FYI:
To fix the problem in the mean time, I've changed line 970 of usersettings.php to this:
791 $username = str_replace ('!', '_', $username);
792 $filename = $username . '.' . $fextension;
-mono
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content