Last modified: 2014-05-10 11:41:34 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T37454, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 35454 - Error in .htaccess file that address Bug 28235
Error in .htaccess file that address Bug 28235
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
1.18.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-24 13:50 UTC by rffurnrj
Modified: 2014-05-10 11:41 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description rffurnrj 2012-03-24 13:50:26 UTC
The .htaccess file installed in the images directory to address Bug 23285 includes the line:

RewriteCond %{QUERY_STRING} \.[^\\/:*?\x22<>|%]+(#|\?|$) [nocase]

However, the # sign in the regex indicates that the remainder of the line should be treated as a comment.

The line should be corrected, by escaping the # sign as follows:

RewriteCond %{QUERY_STRING} \.[^\\/:*?\x22<>|%]+(\#|\?|$) [nocase]
Comment 1 Sam Reed (reedy) 2012-03-24 17:55:24 UTC
(In reply to comment #0)
> The .htaccess file installed in the images directory to address Bug 23285
> includes the line:
> 
> RewriteCond %{QUERY_STRING} \.[^\\/:*?\x22<>|%]+(#|\?|$) [nocase]
> 
> However, the # sign in the regex indicates that the remainder of the line
> should be treated as a comment.
> 
> The line should be corrected, by escaping the # sign as follows:
> 
> RewriteCond %{QUERY_STRING} \.[^\\/:*?\x22<>|%]+(\#|\?|$) [nocase]

I think you mean another bug. bug 23285 is about login issues
Comment 2 Alexandre Emsenhuber [IAlex] 2012-03-26 09:07:56 UTC
The correct bug is bug 28235.
Comment 3 Jesús Martínez Novo (Ciencia Al Poder) 2014-05-10 11:41:34 UTC
The # doesn't need to be scaped there.

Using this partial URL as example:
 /images/asdad?sadsd.asass

I've edited the .htaccess changing the condition (since apparently I wasn't able to trigger the forbidden error with the current line using a "#" in the URL:

 RewriteCond %{QUERY_STRING} \.[^\\/:*?\x22<>|%]+(#|b)ss [nocase]

Result: 404

 RewriteCond %{QUERY_STRING} \.[^\\/:*?\x22<>|%]+(#|a|b)ss [nocase]

Result: 403

So basically, the # works without escaping

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links