Skip to content

Commit 73104ac

Browse files
committed
Escape regex in parse_selector too
1 parent 03176ae commit 73104ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -692,8 +692,8 @@ protected function parse_selector($selector_string) {
692692
// Notice the \[ starting the attbute? and the @? following? This implies that an attribute can begin with an @ sign that is not captured.
693693
// This implies that an html attribute specifier may start with an @ sign that is NOT captured by the expression.
694694
// farther study is required to determine of this should be documented or removed.
695-
// $pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
696-
$pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
695+
// $pattern = "/([\w\-:\*]*)(?:\#([\w\-]+)|\.([\w\-]+))?(?:\[@?(!?[\w\-]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
696+
$pattern = "/([\w\-:\*]*)(?:\#([\w\-]+)|\.([\w\-]+))?(?:\[@?(!?[\w\-:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
697697
preg_match_all($pattern, trim($selector_string).' ', $matches, PREG_SET_ORDER);
698698
if (is_object($debugObject)) {$debugObject->debugLog(2, "Matches Array: ", $matches);}
699699

0 commit comments

Comments
 (0)