Project

General

Profile

« Previous | Next » 

Revision 8031

web/main/.htaccess: translate dotpaths: Allow the part before the [] escape to contain [], to support labels that end in [] (like PHP array vars in the query string) labels with a simple array-subscript syntax (a[b]). This also shortens the regexp and makes it more readable without the \[\] in [^.\[\]/] . Note that this also allows invalid combinations of [] exprs (e.g. more than one per level or unbalanced []), which will still be translated but will probably not have the desired result.

View differences:

.htaccess
29 29
# if no . suffix, seal /-path so the filename is not reinterpreted as a dotpath
30 30
# e.g. a/[b.c] -> a/[b.c]/ so it doesn't become a/b/c after []-unescaping
31 31
# this is needed because mod_rewrite often runs the same rules again
32
RewriteRule ^(.*/)?(?=.)([^.\[\]/]*)(?:\[([^\[\]/]*)\])?(?:\.([^/]*))?$ $1$2$3/$4 [discardpath,noescape,next]
32
RewriteRule ^(.*/)?(?=.)([^./]*?)(?:\[([^\[\]/]*)\])?(?:\.([^/]*))?$ $1$2$3/$4 [discardpath,noescape,next]
33 33
	# discardpath: avoids infinite loop by not reappending PATH_INFO (filename)
34 34

  
35 35
# non-filesystem paths

Also available in: Unified diff