@@ -90,7 +90,7 @@ var TEXT_REGEXP = /^[\x20-\x7e\x80-\xff]+$/
9090var TOKEN_REGEXP = / ^ [ ! # $ % & ' * + . 0 - 9 A - Z ^ _ ` a - z | ~ - ] + $ /
9191
9292/**
93- * RegExp for various RFC 5987 grammar
93+ * RegExp for parsing extended parameter values per RFC 5987.
9494 *
9595 * ext-value = charset "'" [ language ] "'" value-chars
9696 * charset = "UTF-8" / "ISO-8859-1" / mime-charset
@@ -99,19 +99,20 @@ var TOKEN_REGEXP = /^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/
9999 * / "!" / "#" / "$" / "%" / "&"
100100 * / "+" / "-" / "^" / "_" / "`"
101101 * / "{" / "}" / "~"
102- * language = ( 2*3ALPHA [ extlang ] )
103- * / 4ALPHA
104- * / 5*8ALPHA
105- * extlang = *3( "-" 3ALPHA )
102+ *
103+ * language = <Language-Tag as defined in RFC 5646, Section 2.1>
104+ * (Optional: the two literal single quotes MUST appear,
105+ * but the language field inside them may be empty.
106+ * We ignoring the language content rather than validate it)
107+ *
106108 * value-chars = *( pct-encoded / attr-char )
107109 * pct-encoded = "%" HEXDIG HEXDIG
108110 * attr-char = ALPHA / DIGIT
109111 * / "!" / "#" / "$" / "&" / "+" / "-" / "."
110112 * / "^" / "_" / "`" / "|" / "~"
111113 * @private
112114 */
113-
114- var EXT_VALUE_REGEXP = / ^ ( [ A - Z a - z 0 - 9 ! # $ % & + \- ^ _ ` { } ~ ] + ) ' (?: [ A - Z a - z ] { 2 , 3 } (?: - [ A - Z a - z ] { 3 } ) { 0 , 3 } | [ A - Z a - z ] { 4 , 8 } | ) ' ( (?: % [ 0 - 9 A - F a - f ] { 2 } | [ A - Z a - z 0 - 9 ! # $ & + . ^ _ ` | ~ - ] ) + ) $ /
115+ var EXT_VALUE_REGEXP = / ( [ A - Z a - z 0 - 9 ! # $ % & + \- ^ _ ` { } ~ ] + ) ' (?: [ ^ ' ] * ) ' ( (?: % [ 0 - 9 A - F a - f ] { 2 } | [ A - Z a - z 0 - 9 ! # $ & + . ^ _ ` | ~ - ] ) + ) $ /
115116
116117/**
117118 * RegExp for various RFC 6266 grammar
0 commit comments