El Lunes, 9 de Abril de 2007, Brion Vibber escribió:
Alejandro Exojo wrote:
Yesterday I uploaded an image and, unfortunately, I named it "Holsten_Lemon+.jpg". I completely forgot that '+' is a special character in URLs.
'+' has been allowed in titles in the wiki since 1.8 (or earlier if you add it explicitly to $wgLegalTitleChars); as long as it's properly encoded everything works fine, just as it does for '&' and '?'.
Oh, I didn't knew that. Thanks.
It looks to me like you've got some bogus URL rewriting going on which is stripping the encoded '+'s (%2b), leaving them to be interpreted as spaces.
You're right. I tried encoding the plus sign with %2B, as platonides suggests, but only in the URL that should be rewritten. If I go to index.php?title=Image:Holsten_Lemon%2B.jpg it works!
My rewriting is done with this:
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php?title=$1 [L,QSA]
I tried encoding '?', and it works, so I still have to investigate what's wrong, but at least I know where is the problem. :)
You should check if you have the same problem with ampersands or question marks (depending on how you do the rewrite).
First: What should I do? I prefer to delete the file and upload it with a proper name, but I don't know how to do it. If I delete the file in the server, I suppose that some tables of the database have to be fixed, but I don't know which ones.
DELETE FROM image WHERE img_name='Holsten_Lemon+.jpg';
And that's all? I did a search in a mysql dump, and it seems it appears also in the table 'page' and 'logging'. Can I ignore them?
Thanks again.