|
13 | 13 | # Match a content type <application>/<type> |
14 | 14 | (?P<content_type>[-a-zA-Z0-9.]+/[-a-zA-Z0-9.]+) |
15 | 15 | # Match any character set and encoding |
16 | | - # Note that this does not prevent the |
17 | | - # same one being set twice |
18 | | - # The charset group is currently unused |
19 | | - (?:;charset=(?P<charset>[-a-zA-Z0-9]+)|;(?P<encoding>base64)){0,2} |
20 | | - # Match the base64-encoded or urlencoded |
21 | | - # data |
22 | | - # The data group is currently unused |
23 | | - (?P<data>,(?P<base64_encoded_data>[a-zA-Z0-9+/]+=*|(?P<url_encoded_data>[a-zA-Z0-9]+|%[a-fA-F0-9]{2}))) |
| 16 | + (?:(?:;charset=(?:[-a-zA-Z0-9]+)(?:;(?:base64))?) |
| 17 | + |(?:;(?:base64))?(?:;charset=(?:[-a-zA-Z0-9]+))?) |
| 18 | + # Assume the rest is data |
| 19 | + ,.* |
24 | 20 | $ |
25 | 21 | ''', |
26 | 22 | re.VERBOSE) |
@@ -221,19 +217,6 @@ def allowed_token(self, token, token_type): |
221 | 217 | delattrs[attr] |
222 | 218 | ifm.group('content_type')notinself.allowed_content_types: |
223 | 219 | delattrs[attr] |
224 | | -ifm.group('encoding'): |
225 | | -ifm.group('encoding')=='base64': |
226 | | -# If the encoding identifier is base64, then |
227 | | -# make sure the data is encoded in base64 |
228 | | -ifnotm.group('base64_encoded_data'): |
229 | | -delattrs[attr] |
230 | | -else: |
231 | | -delattrs[attr] |
232 | | -else: |
233 | | -# If the encoding is not given, expect the data to |
234 | | -# be urlencoded |
235 | | -ifnotm.group('url_encoded_data'): |
236 | | -delattrs[attr] |
237 | 220 |
|
238 | 221 | forattrinself.svg_attr_val_allows_ref: |
239 | 222 | ifattrinattrs: |
|