Commits

Matthew Marshall committed 5bc05c1

Fixed url matching for repositories with dots and dashes in their names.

Comments (0)

Files changed (2)

 RewriteCond %{HTTP_USER_AGENT} ^mercurial.*
 RewriteRule ^(u/.+)$ hgfcgi/dispatch.fcgi/$1 [L]
 
-RewriteRule ^(u/\w+/\w+/?)$ dispatch.fcgi/$1 [L]
-RewriteRule ^(u/\w+/\w+/edit/?)$ dispatch.fcgi/$1 [L]
-RewriteRule ^(u/\w+/\w+/delete/?)$ dispatch.fcgi/$1 [L]
+RewriteRule ^(u/\w+/\w(\w|-|\.)+\w/?)$ dispatch.fcgi/$1 [L]
+RewriteRule ^(u/\w+/\w(\w|-|\.)+\w/edit/?)$ dispatch.fcgi/$1 [L]
+RewriteRule ^(u/\w+/\w(\w|-|\.)+\w/delete/?)$ dispatch.fcgi/$1 [L]
 
 RewriteRule ^(u/.+)$ hgfcgi/dispatch.fcgi/$1 [L]
 
     (r'^tos/', direct_to_template, {'template':'tos.html'}),
     (r'^about/', direct_to_template, {'template':'about.html'}),
 
-    (r'^u/(?P<username>\w+)/(?P<reponame>\w+)/$', 'freehg.repos.views.summary'),
-    (r'^u/(?P<username>\w+)/(?P<reponame>\w+)/edit/$',
+    (r'^u/(?P<username>\w+)/(?P<reponame>\w(\w|-|\.)+\w)/$', 'freehg.repos.views.summary'),
+    (r'^u/(?P<username>\w+)/(?P<reponame>\w(\w|-|\.)+\w)/edit/$',
             'freehg.repos.views.edit_repo'),
-    (r'^u/(?P<username>\w+)/(?P<reponame>\w+)/delete/$',
+    (r'^u/(?P<username>\w+)/(?P<reponame>\w(\w|-|\.)+\w)/delete/$',
             'freehg.repos.views.delete_repo'),
     (r'^repo_deleted/$', direct_to_template, {'template':'repos/deleted.html'}),