← All changes
|
json-endpoints/jetpack/class.jetpack-json-api-core-modify-endpoint.php
+8
-3
12.2.3
→
16.3-a.1
View file →
| @@ -1,11 +1,17 @@ | ||
| 1 | 1 | <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName |
| 2 | 2 | |
| 3 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 4 | + exit( 0 ); | |
| 5 | +} | |
| 6 | + | |
| 3 | 7 | /** |
| 4 | 8 | * Core modify endpoint class. |
| 5 | 9 | * |
| 6 | 10 | * POST /sites/%s/core |
| 7 | 11 | * POST /sites/%s/core/update |
| 12 | + * | |
| 13 | + * @phan-constructor-used-for-side-effects | |
| 8 | 14 | */ |
| 9 | 15 | class Jetpack_JSON_API_Core_Modify_Endpoint extends Jetpack_JSON_API_Core_Endpoint { |
| 10 | 16 | |
| 11 | 17 | /** |
| @@ -57,10 +63,10 @@ | ||
| 57 | 63 | * @return string|false|WP_Error New WordPress version on success, false or WP_Error on failure. |
| 58 | 64 | */ |
| 59 | 65 | protected function update() { |
| 60 | 66 | $args = $this->input(); |
| 61 | - $version = isset( $args['version'] ) ? $args['version'] : false; | |
| 62 | - $locale = isset( $args['locale'] ) ? $args['locale'] : get_locale(); | |
| 67 | + $version = $args['version'] ?? false; | |
| 68 | + $locale = $args['locale'] ?? get_locale(); | |
| 63 | 69 | |
| 64 | 70 | include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; |
| 65 | 71 | |
| 66 | 72 | delete_site_transient( 'update_core' ); |
| @@ -114,6 +120,5 @@ | ||
| 114 | 120 | remove_filter( 'allow_major_auto_core_updates', '__return_true' ); |
| 115 | 121 | remove_filter( 'send_core_update_notification_email', '__return_false' ); |
| 116 | 122 | return $update; |
| 117 | 123 | } |
| 118 | - | |
| 119 | 124 | } |