Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
services
t3o sites
extensions.typo3.org
extensions.typo3.org
Commits
1f5e994f
Commit
1f5e994f
authored
May 10, 2021
by
Thomas Löffler
Browse files
[BUGFIX] Use full url to the distribution images in XML file
parent
ee4a40c9
Pipeline
#11346
failed with stages
in 3 minutes and 43 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
extensions/ter_fe2/Classes/Service/ExtensionIndexService.php
View file @
1f5e994f
...
...
@@ -16,6 +16,8 @@ use Psr\Log\LoggerAwareInterface;
use
Psr\Log\LoggerAwareTrait
;
use
T3o\Ter\Api\Configuration
;
use
T3o\Ter\Exception\InternalServerErrorException
;
use
TYPO3\CMS\Core\Resource\ResourceFactory
;
use
TYPO3\CMS\Core\Site\SiteFinder
;
use
TYPO3\CMS\Core\Utility\GeneralUtility
;
/**
...
...
@@ -117,6 +119,13 @@ class ExtensionIndexService implements LoggerAwareInterface
$dom
=
new
\
DOMDocument
(
'1.0'
,
'utf-8'
);
$dom
->
formatOutput
=
true
;
$extensionsObj
=
$dom
->
appendChild
(
new
\
DOMElement
(
'extensions'
));
$distributionBaseUrl
=
implode
(
''
,
[
(
string
)
GeneralUtility
::
makeInstance
(
SiteFinder
::
class
)
->
getSiteByIdentifier
(
'extensions'
)
->
getBase
()
.
'/'
,
ResourceFactory
::
getInstance
()
->
getDefaultStorage
()
->
getFolder
(
'ter'
)
->
getPublicUrl
()
]
);
// Create the nested XML structure:
foreach
(
$extensionsAndVersionsArr
as
$extensionKey
=>
$extensionVersionsArr
)
{
...
...
@@ -144,10 +153,22 @@ class ExtensionIndexService implements LoggerAwareInterface
$distributionImage
=
$prefixDistributionFilePath
.
'Distribution.png'
;
$distributionWelcomeImage
=
$prefixDistributionFilePath
.
'DistributionWelcome.png'
;
if
(
is_file
(
$this
->
basePath
.
$distributionImage
))
{
$versionObj
->
appendChild
(
new
\
DOMElement
(
'distributionImage'
,
$this
->
xmlentities
(
$distributionImage
)));
$distributionImageUrl
=
$distributionBaseUrl
.
$distributionImage
;
$versionObj
->
appendChild
(
new
\
DOMElement
(
'distributionImage'
,
$this
->
xmlentities
(
$distributionImageUrl
)
)
);
}
if
(
is_file
(
$this
->
basePath
.
$distributionWelcomeImage
))
{
$versionObj
->
appendChild
(
new
\
DOMElement
(
'distributionImageWelcome'
,
$this
->
xmlentities
(
$distributionWelcomeImage
)));
$distributionWelcomeImageUrl
=
$distributionBaseUrl
.
$distributionWelcomeImage
;
$versionObj
->
appendChild
(
new
\
DOMElement
(
'distributionImageWelcome'
,
$this
->
xmlentities
(
$distributionWelcomeImageUrl
)
)
);
}
}
$versionObj
->
appendChild
(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment