← All changes
|
backend/src/Data/Transformers/PluginUpdatesTransformer.php
+4
-2
0.3.0
→
1.5.5.1
View file →
| @@ -19,8 +19,10 @@ | ||
| 19 | 19 | } |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | if ( isset( $update->banners ) ) { |
| 23 | + $update->banners = (array) $update->banners; | |
| 24 | + | |
| 23 | 25 | if ( isset( $update->banners['2x'] ) ) { |
| 24 | 26 | $banner = $update->banners['2x']; |
| 25 | 27 | } elseif ( isset( $update->banners['1x'] ) ) { |
| 26 | 28 | $banner = $update->banners['1x']; |
| @@ -30,9 +32,9 @@ | ||
| 30 | 32 | return [ |
| 31 | 33 | 'author' => $plugin->AuthorName, |
| 32 | 34 | 'authorURI' => $plugin->AuthorURI, |
| 33 | 35 | 'banner' => $banner, |
| 34 | - 'bannerSizes' => $update->banners, | |
| 36 | + 'bannerSizes' => isset( $update->banners ) ? $update->banners : null, | |
| 35 | 37 | 'content' => $plugin->Description, |
| 36 | 38 | 'id' => $update->plugin, |
| 37 | 39 | 'meta' => $plugin->Version . ' by ' . $plugin->AuthorName, |
| 38 | 40 | 'metaUpdated' => $update->new_version . ' by ' . $plugin->AuthorName, |
| @@ -43,9 +45,9 @@ | ||
| 43 | 45 | 'type' => 'plugin', |
| 44 | 46 | 'version' => $plugin->Version, |
| 45 | 47 | 'updatedVersion' => $update->new_version, |
| 46 | 48 | 'tested' => $update->tested, |
| 47 | - 'requiresPHP' => $update->requires_php, | |
| 49 | + 'requiresPHP' => isset( $update->requires_php ) ? $update->requires_php : null, | |
| 48 | 50 | 'pluginURI' => $plugin->PluginURI, |
| 49 | 51 | ]; |
| 50 | 52 | } |
| 51 | 53 | } |