Skip to content

Commit

Permalink
Merge pull request #4 from jlamb1/master
Browse files Browse the repository at this point in the history
Add regex escaping for PHP 7.3 support
  • Loading branch information
balazscsaba2006 committed Apr 17, 2019
2 parents 89e90f9 + 17a9a99 commit 1d3f7fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/lib/simple_html_dom.php
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ protected function parse_selector($selector_string) {
// This implies that an html attribute specifier may start with an @ sign that is NOT captured by the expression.
// farther study is required to determine of this should be documented or removed.
// $pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
$pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
$pattern = "/([\w\-:\*]*)(?:\#([\w\-]+)|\.([\w\-]+))?(?:\[@?(!?[\w\-:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
preg_match_all($pattern, trim($selector_string).' ', $matches, PREG_SET_ORDER);
if (is_object($debug_object)) {$debug_object->debug_log(2, "Matches Array: ", $matches);}

Expand Down Expand Up @@ -1382,7 +1382,7 @@ protected function read_tag()
return true;
}

if (!preg_match("/^[\w-:]+$/", $tag)) {
if (!preg_match("/^[\w\-:]+$/", $tag)) {
$node->_[HDOM_INFO_TEXT] = '<' . $tag . $this->copy_until('<>');
if ($this->char==='<') {
$this->link_nodes($node, false);
Expand Down
2 changes: 1 addition & 1 deletion src/twig/TwigExtensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ private function cacheImageSize($key, $width, $height, $expire = 604800): void
*
* @return string|null
*/
private function readImageSize(string $url): ?array
private function readImageSize(string $url)
{
$client = new FasterImage();

Expand Down

0 comments on commit 1d3f7fe

Please sign in to comment.