-
Notifications
You must be signed in to change notification settings - Fork 109
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
Fix notice and wrong Regex #781
Conversation
src/cdn.cls.php
Outdated
foreach ($matches[1] as $k => $url) { | ||
if ($url == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we just use if (!$url)
as empty case should be bypassed as well??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, added the changed
src/cdn.cls.php
Outdated
@@ -306,8 +306,12 @@ private function _replace_inline_css() | |||
* @see #685485 | |||
* @since 3.0 | |||
*/ | |||
preg_match_all('/url\((?![\'"]?data)[\'"]?([^\)\'"\\\]+)[\'"]?\)/i', $this->content, $matches); | |||
preg_match_all('/url\((?![\'"]?data)[\'"]?(.*?)[\'"]?\)/i', $this->content, $matches); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we change (.*?)
to (.+?)
? @timotei-litespeed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed, at least it will filter out empty url :)
src/cdn.cls.php
Outdated
foreach ($matches[1] as $k => $url) { | ||
if (!$url) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As its used + now, is this condition redundant? @timotei-litespeed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
Found after looking for this issue: https://wordpress.org/support/topic/php-deprecated-notice-14/