litespeed-dummy removal – incorrect regex
-
Like lots of other reports, I have an unwanted and empty
wp-content/plugins/litespeed-cache/assets/css/litespeed-dummy.cssbeing served.I am on v7.9.1 of the LiteSpeed WordPress plugin and I cannot see any option to remove or disable it.
The exact HTML code being injected is
<link href="https://example.blog/wp-content/plugins/litespeed-cache/assets/css/litespeed-dummy.css?ver=7.1" id=litespeed-cache-dummy-css media=all rel=stylesheet>The problem is caused by your regex
<link [ \w='\"/-]*id=['\"]litespeed-cache-dummy-css['\"][ \w='\"/-]*href=['\"].+assets/css/litespeed-dummy\.css[?\w.=-]*['\"][ \w='\"/-]*>#isUIt is expecting a specific order – the ID first – and that the ID is surrounded with quotes.
Trying to parse HTML using a regular expression is not a good idea. But, if you must, I suggest just searching for the ID string rather than assuming it is in a specific order. This should work:
<link[^>]*litespeed-cache-dummy-css[^>]*>Report CLQEEGAV
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
You must be logged in to reply to this topic.