Skip to content

Commit 67d279c

Browse files
authored
[5.4] Convert TUF update info URL into legacy format (joomla#45980)
* Convert update infourl into legacy data format
1 parent 941268e commit 67d279c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

libraries/src/Updater/Update.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,10 +612,19 @@ public function loadFromTuf(TufMetadata $metadataTable, string $url, $minimumSta
612612

613613
// If the latest item is set then we transfer it to where we want to
614614
if (isset($this->latest)) {
615+
// Set generic variables from latest update
615616
foreach (get_object_vars($this->latest) as $key => $val) {
616617
$this->$key = (object) ['_data' => $val];
617618
}
618619

620+
// Convert infourl into legacy data structure
621+
if (!empty($this->latest->infourl) && \is_array($this->latest->infourl)) {
622+
$this->infourl = (object) [
623+
'_data' => $this->latest->infourl["url"],
624+
'title' => $this->latest->infourl["title"],
625+
];
626+
}
627+
619628
foreach ($this->downloadSources as $source) {
620629
$this->downloadurl = (object) [
621630
'_data' => $source->url,

0 commit comments

Comments
 (0)