-
Notifications
You must be signed in to change notification settings - Fork 384
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4300 from ampproject/fix/4197-invalid-css
Require unreleased version of PHP-CSS-Parser
- Loading branch information
Showing
5 changed files
with
46 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Index: lib/Sabberworm/CSS/Property/Selector.php | ||
=================================================================== | ||
--- lib/Sabberworm/CSS/Property/Selector.php (revision 134f4e62fe8ab9f316425f3c0f480b3f4f52d804) | ||
+++ lib/Sabberworm/CSS/Property/Selector.php (date 1581832944211) | ||
@@ -41,12 +41,12 @@ | ||
private $iSpecificity; | ||
|
||
public static function isValid($sSelector) { | ||
- return preg_match("/^([a-zA-Z0-9\x{00A0}-\x{FFFF}_\^\$\|\*\=\"\'\~\[\]\(\)\-\s\.:#\+\>]*|\s*?[\+-]?\d+\%\s*)$/u", $sSelector); | ||
+ return preg_match("/^([a-zA-Z0-9,@\\\x{00A0}-\x{FFFF}_\^\$\|\*\=\"\'\~\[\]\(\)\-\s\.:#\+\>]*|\s*?[\+-]?\d+\%\s*)$/u", $sSelector); | ||
} | ||
|
||
public function __construct($sSelector, $bCalculateSpecificity = false) { | ||
if (!Selector::isValid($sSelector)) { | ||
- throw new UnexpectedTokenException("Selector did not match '/^([a-zA-Z0-9\x{00A0}-\x{FFFF}_\^\$\|\*\=\"\'\~\[\]\(\)\-\s\.:#\+\>]*|\s*?[\+-]?\d+\%\s*)$/u'.", $sSelector, "custom"); | ||
+ throw new UnexpectedTokenException("Selector did not match '/^([a-zA-Z0-9,@\\\x{00A0}-\x{FFFF}_\^\$\|\*\=\"\'\~\[\]\(\)\-\s\.:#\+\>]*|\s*?[\+-]?\d+\%\s*)$/u'.", $sSelector, "custom"); | ||
} | ||
$this->setSelector($sSelector); | ||
if ($bCalculateSpecificity) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters