Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ae16b2d

Browse filesBrowse files
PhilETaylornicolas-grekas
authored andcommitted
[AssetMapper] Fix JavaScriptImportPathCompiler regression in regex
1 parent 038e28c commit ae16b2d
Copy full SHA for ae16b2d

File tree

Expand file treeCollapse file tree

1 file changed

+5
-6
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-6
lines changed

‎src/Symfony/Component/AssetMapper/Compiler/JavaScriptImportPathCompiler.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/AssetMapper/Compiler/JavaScriptImportPathCompiler.php
+5-6Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,15 @@
2828
final class JavaScriptImportPathCompiler implements AssetCompilerInterface
2929
{
3030
/**
31-
* @see https://regex101.com/r/1iBAIb/1
31+
* @see https://regex101.com/r/1iBAIb/2
3232
*/
3333
private const IMPORT_PATTERN = '/
34-
^
35-
(?:\/\/.*) # Lines that start with comments
34+
^(?:\/\/.*) # Lines that start with comments
3635
|
3736
(?:
38-
\'(?:[^\'\\\\\n]|\\\\.)*\' # Strings enclosed in single quotes
37+
\'(?:[^\'\\\\\n]|\\\\.)*+\' # Strings enclosed in single quotes
3938
|
40-
"(?:[^"\\\\\n]|\\\\.)*" # Strings enclosed in double quotes
39+
"(?:[^"\\\\\n]|\\\\.)*+" # Strings enclosed in double quotes
4140
)
4241
|
4342
(?: # Import statements (script captured)
@@ -49,7 +48,7 @@ final class JavaScriptImportPathCompiler implements AssetCompilerInterface
4948
|
5049
\bimport\(
5150
)
52-
\s*[\'"`](\.\/[^\'"`\n]+|(\.\.\/)*[^\'"`\n]+)[\'"`]\s*[;\)]
51+
\s*[\'"`](\.\/[^\'"`\n]++|(\.\.\/)*+[^\'"`\n]++)[\'"`]\s*[;\)]
5352
?
5453
/mx';
5554

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.