File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
app/code/Magento/MediaContent/Model Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ public function __construct(
5353 */
5454 public function execute (string $ content ): array
5555 {
56- $ paths = [];
56+ $ matchesArrays = [];
5757
5858 foreach ($ this ->searchPatternConfig ->get () as $ pattern ) {
5959 if (empty ($ pattern )) {
@@ -63,11 +63,11 @@ public function execute(string $content): array
6363 preg_match_all ($ pattern , $ content , $ matches , PREG_PATTERN_ORDER );
6464
6565 if (!empty ($ matches [1 ])) {
66- $ paths = array_merge ( $ paths , array_unique ( $ matches [1 ])) ;
66+ $ matchesArrays [] = $ matches [1 ];
6767 }
6868 }
6969
70- return $ this ->getAssetsByPaths (array_unique ($ paths ));
70+ return $ this ->getAssetsByPaths (array_unique (array_merge ([], ... $ matchesArrays ) ));
7171 }
7272
7373 /**
@@ -104,7 +104,7 @@ private function getAssetsByPaths(array $paths): array
104104 private function getPathStartingWithSlash (string $ path ): string
105105 {
106106 $ normalizedPath = ltrim ($ path , '/ ' );
107- if (strpos ($ normalizedPath , '/ ' )) {
107+ if (strpos ($ normalizedPath , '/ ' ) === false ) {
108108 return $ normalizedPath ;
109109 }
110110 return '/ ' . $ normalizedPath ;
You can’t perform that action at this time.
0 commit comments