[or-cvs] r14472: nickm was right. I am happy to replace my dirty hack with so (check/trunk/cgi-bin)

ioerror at seul.org ioerror at seul.org
Fri Apr 25 11:53:57 UTC 2008


Author: ioerror
Date: 2008-04-25 07:53:56 -0400 (Fri, 25 Apr 2008)
New Revision: 14472

Modified:
   check/trunk/cgi-bin/index.py
Log:
nickm was right. I am happy to replace my dirty hack with something proper.


Modified: check/trunk/cgi-bin/index.py
===================================================================
--- check/trunk/cgi-bin/index.py	2008-04-25 10:57:08 UTC (rev 14471)
+++ check/trunk/cgi-bin/index.py	2008-04-25 11:53:56 UTC (rev 14472)
@@ -74,20 +74,10 @@
 
 def parseLang(req):
 
-    queryString = req.subprocess_env['QUERY_STRING']
     user_supplied_lang = None
+    formSubmission=util.FieldStorage(req)
+    user_supplied_lang = formSubmission.getfirst("lang", None)
 
-    # TODO - Nick thinks this is horrible and should be done in a 
-    # more pythonish cgi manner
-    if queryString :
-        queries = queryString.split('&')
-
-        for query in queries:
-            key,value = query.split('=')
-	    # Currently, we only care about the sjmurdoch supplied 'lang'
-            if key == 'lang':
-                user_supplied_lang = value
-
     # These are the locales we're supporting currently
     # If the user passes in a locale that matches it, great
     # However, anything that we don't support will result in us using a default locale



More information about the tor-commits mailing list