@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | public function check() { |
| 57 | 57 | // Look up the cache - it is invalidated all 30 minutes |
| 58 | - if (((int)$this->config->getAppValue('core', 'lastupdatedat') + 1800) > time()) { |
|
| 58 | + if (((int) $this->config->getAppValue('core', 'lastupdatedat') + 1800) > time()) { |
|
| 59 | 59 | return json_decode($this->config->getAppValue('core', 'lastupdateResult'), true); |
| 60 | 60 | } |
| 61 | 61 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $versionString = implode('x', $version); |
| 80 | 80 | |
| 81 | 81 | //fetch xml data from updater |
| 82 | - $url = $updaterUrl . '?version=' . $versionString; |
|
| 82 | + $url = $updaterUrl.'?version='.$versionString; |
|
| 83 | 83 | |
| 84 | 84 | $tmp = []; |
| 85 | 85 | try { |
@@ -93,16 +93,16 @@ discard block |
||
| 93 | 93 | $data = @simplexml_load_string($xml); |
| 94 | 94 | libxml_disable_entity_loader($loadEntities); |
| 95 | 95 | if ($data !== false) { |
| 96 | - $tmp['version'] = (string)$data->version; |
|
| 97 | - $tmp['versionstring'] = (string)$data->versionstring; |
|
| 98 | - $tmp['url'] = (string)$data->url; |
|
| 99 | - $tmp['web'] = (string)$data->web; |
|
| 100 | - $tmp['changelog'] = isset($data->changelog) ? (string)$data->changelog : null; |
|
| 96 | + $tmp['version'] = (string) $data->version; |
|
| 97 | + $tmp['versionstring'] = (string) $data->versionstring; |
|
| 98 | + $tmp['url'] = (string) $data->url; |
|
| 99 | + $tmp['web'] = (string) $data->web; |
|
| 100 | + $tmp['changelog'] = isset($data->changelog) ? (string) $data->changelog : null; |
|
| 101 | 101 | // TODO: one's it is decided, use the proper field… |
| 102 | - $tmp['whatsNew'] = isset($data->whatsNew) ? ((array)$data->whatsNew)['item'] : null; |
|
| 103 | - $tmp['whatsNew'] = isset($data->whatsNew_admin) ? ((array)$data->whatsNew_admin)['item'] : (string)$data->whatsNew; |
|
| 104 | - $tmp['autoupdater'] = (string)$data->autoupdater; |
|
| 105 | - $tmp['eol'] = isset($data->eol) ? (string)$data->eol : '0'; |
|
| 102 | + $tmp['whatsNew'] = isset($data->whatsNew) ? ((array) $data->whatsNew)['item'] : null; |
|
| 103 | + $tmp['whatsNew'] = isset($data->whatsNew_admin) ? ((array) $data->whatsNew_admin)['item'] : (string) $data->whatsNew; |
|
| 104 | + $tmp['autoupdater'] = (string) $data->autoupdater; |
|
| 105 | + $tmp['eol'] = isset($data->eol) ? (string) $data->eol : '0'; |
|
| 106 | 106 | } else { |
| 107 | 107 | libxml_clear_errors(); |
| 108 | 108 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | if (strpos($data['changelog'], 'https://') === 0) { |
| 60 | 60 | $result['changelog'] = $data['changelog']; |
| 61 | 61 | } |
| 62 | - if($data['whatsNew'] !== null) { |
|
| 62 | + if ($data['whatsNew'] !== null) { |
|
| 63 | 63 | $result['whatsNew'] = $data['whatsNew']; |
| 64 | 64 | } |
| 65 | 65 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | * @param array $data |
| 74 | 74 | */ |
| 75 | 75 | public function populateJavaScriptVariables(array $data) { |
| 76 | - $data['array']['oc_updateState'] = json_encode([ |
|
| 76 | + $data['array']['oc_updateState'] = json_encode([ |
|
| 77 | 77 | 'updateAvailable' => true, |
| 78 | 78 | 'updateVersion' => $this->getUpdateState()['updateVersion'], |
| 79 | 79 | 'updateLink' => $this->getUpdateState()['updateLink'] ?? '', |