File tree 1 file changed +4
-4
lines changed
app/code/Magento/MediaContent/Model 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ public function __construct(
53
53
*/
54
54
public function execute (string $ content ): array
55
55
{
56
- $ paths = [];
56
+ $ matchesArrays = [];
57
57
58
58
foreach ($ this ->searchPatternConfig ->get () as $ pattern ) {
59
59
if (empty ($ pattern )) {
@@ -63,11 +63,11 @@ public function execute(string $content): array
63
63
preg_match_all ($ pattern , $ content , $ matches , PREG_PATTERN_ORDER );
64
64
65
65
if (!empty ($ matches [1 ])) {
66
- $ paths = array_merge ( $ paths , array_unique ( $ matches [1 ])) ;
66
+ $ matchesArrays [] = $ matches [1 ];
67
67
}
68
68
}
69
69
70
- return $ this ->getAssetsByPaths (array_unique ($ paths ));
70
+ return $ this ->getAssetsByPaths (array_unique (array_merge ([], ... $ matchesArrays ) ));
71
71
}
72
72
73
73
/**
@@ -104,7 +104,7 @@ private function getAssetsByPaths(array $paths): array
104
104
private function getPathStartingWithSlash (string $ path ): string
105
105
{
106
106
$ normalizedPath = ltrim ($ path , '/ ' );
107
- if (strpos ($ normalizedPath , '/ ' )) {
107
+ if (strpos ($ normalizedPath , '/ ' ) === false ) {
108
108
return $ normalizedPath ;
109
109
}
110
110
return '/ ' . $ normalizedPath ;
You can’t perform that action at this time.
0 commit comments