File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
app/code/Magento/MediaContent/Model Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 14
14
*/
15
15
class Config
16
16
{
17
+ private const XML_PATH_SEARCH_PATTERNS = 'search/patterns ' ;
18
+
17
19
/**
18
20
* @var DataInterface
19
21
*/
@@ -38,4 +40,14 @@ public function get($key = null, $default = null)
38
40
{
39
41
return $ this ->data ->get ($ key , $ default );
40
42
}
43
+
44
+ /**
45
+ * Retrieve search regexp patterns for finding media asset paths within content
46
+ *
47
+ * @return array
48
+ */
49
+ public function getSearchPatterns (): array
50
+ {
51
+ return $ this ->get (self ::XML_PATH_SEARCH_PATTERNS );
52
+ }
41
53
}
Original file line number Diff line number Diff line change 18
18
*/
19
19
class ExtractAssetsFromContent implements ExtractAssetsFromContentInterface
20
20
{
21
- private const XML_PATH_SEARCH_PATTERNS = 'search/patterns ' ;
22
-
23
21
/**
24
22
* @var Config
25
23
*/
@@ -57,7 +55,7 @@ public function execute(string $content): array
57
55
{
58
56
$ paths = [];
59
57
60
- foreach ($ this ->config ->get ( self :: XML_PATH_SEARCH_PATTERNS ) as $ pattern ) {
58
+ foreach ($ this ->config ->getSearchPatterns ( ) as $ pattern ) {
61
59
if (empty ($ pattern )) {
62
60
continue ;
63
61
}
You can’t perform that action at this time.
0 commit comments