[Tutor] Untainting CGI parameters

Alan G alan.gauld at freenet.co.uk
Thu Aug 11 10:06:52 CEST 2005

> I will combine Kent's and your suggestion, because he included a 
> check for an AttributeError:

OK, as a slightly more perl-ish solution to the no Attribute problem
you could also do this:

    type = re.search('\w+', parameters['type'].value).group() or 
except KeyError:
    type = 'page'


Alan G.

More information about the Tutor mailing list