Skip to content
Snippets Groups Projects

Issue #3377120: Regex pattern is invalid: The /e modifier is no longer supported

Open Issue #3377120: Regex pattern is invalid: The /e modifier is no longer supported
1 unresolved thread
Open Joshua Sedler requested to merge issue/pwa-3377120:3377120-regex-pattern-is into 2.x
1 unresolved thread
1 file
+ 6
1
Compare changes
  • Side-by-side
  • Inline
@@ -184,15 +184,20 @@ class PWAController implements ContainerInjectionInterface {
@$dom->loadHTML($data);
$xpath = new \DOMXPath($dom);
// Get all scripts with a src attribute and save the src:
foreach ($xpath->query('//script[@src]') as $script) {
$page_resources[] = $script->getAttribute('src');
}
// Get all links with a relationship to a stylesheet and safe its
// reference:
foreach ($xpath->query('//link[@rel="stylesheet"][@href]') as $stylesheet) {
$page_resources[] = $stylesheet->getAttribute('href');
}
// @todo Get all style elements with attribute set to "all" or "screen"
// and filter them out based on ???.
foreach ($xpath->query('//style[@media="all" or @media="screen"]') as $stylesheets) {
preg_match_all(
"#(/(\S*?\.\S*?))(\s|\;|\)|\]|\[|\{|\}|,|\"|'|:|\<|$|\.\s)#ie",
"#(/(\S*?\.\S*?))(\s|\;|\)|\]|\[|\{|\}|,|\"|'|:|\<|$|\.\s)#i",
' ' . $stylesheets->textContent,
$matches
);
$page_resources = array_merge($page_resources, $matches[0]);
}
foreach ($xpath->query('//img[@src]') as $image) {
Please register or sign in to reply
$page_resources[] = $image->getAttribute('src');
}
Loading