diff --git a/VERSION b/VERSION index 8295db50..9e8b85f2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 1.99.7 (2012-03-12 15:56:12) dev +Version 1.99.7 (2012-03-12 17:47:52) dev diff --git a/gluon/html.py b/gluon/html.py index 0ac760f7..ae14f167 100644 --- a/gluon/html.py +++ b/gluon/html.py @@ -15,19 +15,18 @@ import types import urllib import base64 import sanitizer -import rewrite import itertools import decoder import copy_reg import cPickle import marshal + from HTMLParser import HTMLParser from htmlentitydefs import name2codepoint -from contrib.markmin.markmin2html import render from storage import Storage -from highlight import highlight from utils import web2py_uuid, hmac_hash +from highlight import highlight regex_crlf = re.compile('\r|\n') @@ -227,6 +226,8 @@ def URL( :raises SyntaxError: when a CRLF is found in the generated url """ + from rewrite import url_out # done here in case used not-in web2py + if args in (None,[]): args = [] vars = vars or {} application = None @@ -342,8 +343,8 @@ def URL( if regex_crlf.search(join([application, controller, function, other])): raise SyntaxError, 'CRLF Injection Detected' - url = rewrite.url_out(r, env, application, controller, function, - args, other, scheme, host, port) + url = url_out(r, env, application, controller, function, + args, other, scheme, host, port) return url @@ -1659,6 +1660,10 @@ class INPUT(DIV): return DIV.xml(self) + DIV(self.errors[name], _class='error', errors=None, _id='%s__error' % name).xml() else: + if self['_class'] and self['_class'].endswith('invalidinput'): + self['_class'] = self['_class'][:-12] + if self['_class'] == '': + self['_class'] = None return DIV.xml(self) @@ -2005,7 +2010,7 @@ class BEAUTIFY(DIV): example:: >>> BEAUTIFY(['a', 'b', {'hello': 'world'}]).xml() - '
a | |||
b | |||
|
a | |||
b | |||
|