+ /**
+ * Lazy-initialised attribute name regex, see getAttribNameRegex()
+ */
+ private static $attribNameRegex;
+
+ /**
+ * Used in Sanitizer::decodeTagAttributes to filter attributes.
+ * @return string
+ */
+ static function getAttribNameRegex() {
+ if ( self::$attribNameRegex === null ) {
+ $attribFirst = "[:_\p{L}\p{N}]";
+ $attrib = "[:_\.\-\p{L}\p{N}]";
+ self::$attribNameRegex = "/^({$attribFirst}{$attrib}*)$/sxu";
+ }
+ return self::$attribNameRegex;
+ }
+