Subversion Repositories SmartDukaan

Rev

Rev 15229 | Rev 15731 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15229 Rev 15544
Line 154... Line 154...
154
        
154
        
155
class RawHtml():
155
class RawHtml():
156
    def on_get(self, req, resp, orderId):
156
    def on_get(self, req, resp, orderId):
157
        try:
157
        try:
158
            result = Mysql.getOrderHtml(orderId)
158
            result = Mysql.getOrderHtml(orderId)
-
 
159
            if req.get_param("show") is None:
159
            result = re.subn(r'(src|href|style)=\s?(\'|").*?\2(?s)', '', re.subn(r'<(script|style).*?</\1>(?s)', '', result)[0])[0]
160
                result = re.subn(r'(src|href|style)=\s?(\'|").*?\2(?s)', '', re.subn(r'<(script|style).*?</\1>(?s)', '', result)[0])[0]
160
            resp.body = result
161
            resp.body = result
161
            resp.content_type = 'text/html'
162
            resp.content_type = 'text/html'
162
        except ValueError:
163
        except ValueError:
163
            raise falcon.HTTPError(falcon.HTTP_400,
164
            raise falcon.HTTPError(falcon.HTTP_400,
164
                'Malformed JSON',
165
                'Malformed JSON',