@@ -17,14 +17,18 @@ def redirect(request, path="", script=""):
1717 #
1818 # First look for flag items, stored in the database
1919 # as a command with a leading "^".
20+ if request .method == 'POST' :
21+ rparam = request .POST
22+ else :
23+ rparam = request .GET
2024 for flag in redir .commands .all ().filter (command__startswith = '^' ):
2125 fc = flag .command [1 :].split ("^" )
2226 if len (fc ) > 1 :
23- if request . REQUEST .get ('command' ) != fc [1 ]:
27+ if rparam .get ('command' ) != fc [1 ]:
2428 continue
25- if request . REQUEST .has_key (fc [0 ]):
29+ if rparam .has_key (fc [0 ]):
2630 remove_args .append (fc [0 ])
27- num = re .match ('(\d+)' , request . REQUEST [fc [0 ]])
31+ num = re .match ('(\d+)' , rparam [fc [0 ]])
2832 if (num and int (num .group (1 ))) or (num is None ):
2933 cmd = flag
3034 break
@@ -33,7 +37,7 @@ def redirect(request, path="", script=""):
3337 # for an exact match for the command= parameter.
3438 if cmd is None :
3539 try :
36- cmd = redir .commands .all ().get (command = request . REQUEST ['command' ])
40+ cmd = redir .commands .all ().get (command = rparam ['command' ])
3741 except Command .DoesNotExist :
3842 pass # it's ok, there's no more-specific request.
3943 except KeyError :
@@ -58,7 +62,7 @@ def redirect(request, path="", script=""):
5862 # contains non-ASCII characters. The old scripts didn't support
5963 # non-ASCII characters anyway, so there's no need to handle
6064 # them fully correctly in these redirects.
61- url += str (rest % request . REQUEST )
65+ url += str (rest % rparam )
6266 url += "/"
6367 except :
6468 # rest had something in it that request didn't have, so just
0 commit comments