Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Warning in php 5.3+ #23

Open
csiteru opened this issue Sep 16, 2021 · 0 comments
Open

PHP Warning in php 5.3+ #23

csiteru opened this issue Sep 16, 2021 · 0 comments

Comments

@csiteru
Copy link

csiteru commented Sep 16, 2021

PHP Warning: preg_match(): Compilation failed: invalid range in character class at offset in ............/plugins/system/noextlinks/noextlinks.php on line 469

if ($host = $eUri->toString(array('host', 'port')))
{
	$host    = preg_quote($host);
	$regex[] = str_replace('\*', '[\w-]+', $host);
}

if ($path = $eUri->getPath())
{
	$path    = preg_quote($path);
	$regex[] = str_replace('/\*', '(\/[\w-\~\:\.\/]*|)', $path);
}

$regex = '~^' . implode('', $regex) . '$~iU';

if (preg_match($regex, $uri->toString(array('scheme', 'user', 'pass', 'host', 'port', 'path'))))

I see that problem with regular expressions:

PHP 7.3 has updated its regular expression engine to PCRE2, which brings some breaking changes.
I think the dash in referenced expression needs to be escaped.
More: http://php.net/manual/en/migration73.other-changes.php#migration73.other-changes.pcre

sunra/php-simple-html-dom-parser#64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant