Skip to content

Commit 3ae4472

Browse files
committed
fix(data): load plugin data
1 parent 1bf0eba commit 3ae4472

File tree

1 file changed

+8
-23
lines changed

1 file changed

+8
-23
lines changed

src/Action/LoadPluginAction.php

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -134,36 +134,21 @@ private function fetchExtensionYmlData(string $mainExtensionYmlUrl, string $gith
134134
$pluginData['images'][] = $githubUrl . '/' . $images['file'];
135135
}
136136
}
137-
if (isset($extensionYmlData['store']['description']['en'])) {
138-
$pluginData['description']['en-GB'] = $this->processFileUrls(
139-
$extensionYmlData['store']['description']['en'],
140-
$githubUrl
141-
);
137+
if (isset($extensionYmlData['store']['description']['en'])
138+
&& !str_starts_with($extensionYmlData['store']['description']['en'], 'file:')
139+
) {
140+
$pluginData['description']['en-GB'] = $extensionYmlData['store']['description']['en'];
142141
}
143-
if (isset($extensionYmlData['store']['description']['de'])) {
144-
$pluginData['description']['de-DE'] = $this->processFileUrls(
145-
$extensionYmlData['store']['description']['de'],
146-
$githubUrl
147-
);
142+
if (isset($extensionYmlData['store']['description']['de'])
143+
&& !str_starts_with($extensionYmlData['store']['description']['de'], 'file:')
144+
) {
145+
$pluginData['description']['de-DE'] = $extensionYmlData['store']['description']['de'];
148146
}
149-
150-
// TODO Load from markdown files
151-
152-
// TODO load images from folder
153147
}
154148

155149
return $pluginData;
156150
}
157151

158-
private function processFileUrls(string $data, string $githubUrl): string
159-
{
160-
if (str_starts_with($data, 'file:')) {
161-
return $githubUrl . '/' . substr($data, 5);
162-
}
163-
164-
return $data;
165-
}
166-
167152
private function findSuitableVersion(array $packagistData): ?array
168153
{
169154
$versions = $packagistData['package']['versions'];

0 commit comments

Comments
 (0)