Skip to content

Commit

Permalink
Connection: make sure scheme history option is an array (#33905)
Browse files Browse the repository at this point in the history
Fix a fatal caused by `jetpack_sync_https_history_*` options storing non-array values.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/6732814339
  • Loading branch information
sergeymitr authored and matticbot committed Nov 2, 2023
1 parent f2fc9ea commit 8934605
Show file tree
Hide file tree
Showing 17 changed files with 123 additions and 109 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"automattic/jetpack-autoloader": "^2.12.0",
"automattic/jetpack-composer-plugin": "^1.1.14",
"automattic/jetpack-config": "^1.15.4",
"automattic/jetpack-connection": "^1.58.2",
"automattic/jetpack-connection": "^1.58.3-alpha",
"automattic/jetpack-identity-crisis": "^0.11.2-alpha",
"automattic/jetpack-my-jetpack": "^3.11.1-alpha",
"automattic/jetpack-search": "^0.39.5-alpha",
Expand Down
8 changes: 8 additions & 0 deletions jetpack_vendor/automattic/jetpack-connection/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.58.3-alpha] - unreleased

This is an alpha version! The changes listed here are not final.

### Fixed
- Make sure scheme history option is an array.

## [1.58.2] - 2023-10-19
### Changed
- Updated package dependencies. [#33687]
Expand Down Expand Up @@ -896,6 +903,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Separate the connection library into its own package.

[1.58.3-alpha]: https://github.com/Automattic/jetpack-connection/compare/v1.58.2...v1.58.3-alpha
[1.58.2]: https://github.com/Automattic/jetpack-connection/compare/v1.58.1...v1.58.2
[1.58.1]: https://github.com/Automattic/jetpack-connection/compare/v1.58.0...v1.58.1
[1.58.0]: https://github.com/Automattic/jetpack-connection/compare/v1.57.5...v1.58.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
class Package_Version {

const PACKAGE_VERSION = '1.58.2';
const PACKAGE_VERSION = '1.58.3-alpha';

const PACKAGE_SLUG = 'connection';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public static function get_protocol_normalized_url( $callable, $new_value ) {
$option_key = self::HTTPS_CHECK_OPTION_PREFIX . $callable;

$parsed_url = wp_parse_url( $new_value );

if ( ! $parsed_url ) {
return $new_value;
}
Expand All @@ -98,7 +99,12 @@ public static function get_protocol_normalized_url( $callable, $new_value ) {
} else {
$scheme = '';
}
$scheme_history = get_option( $option_key, array() );
$scheme_history = get_option( $option_key, array() );

if ( ! is_array( $scheme_history ) ) {
$scheme_history = array();
}

$scheme_history[] = $scheme;

// Limit length to self::HTTPS_CHECK_HISTORY.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "jetpack-library",
"license": "GPL-2.0-or-later",
"require": {
"automattic/jetpack-connection": "^1.58.2",
"automattic/jetpack-connection": "^1.58.3-alpha",
"automattic/jetpack-constants": "^1.6.23",
"automattic/jetpack-status": "^1.18.5",
"automattic/jetpack-logo": "^1.6.3",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-jitm/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"require": {
"automattic/jetpack-a8c-mc-stats": "^1.4.22",
"automattic/jetpack-assets": "^1.18.14-alpha",
"automattic/jetpack-connection": "^1.58.2",
"automattic/jetpack-connection": "^1.58.3-alpha",
"automattic/jetpack-device-detection": "^1.4.27",
"automattic/jetpack-logo": "^1.6.3",
"automattic/jetpack-partner": "^1.7.25",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-licensing/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "jetpack-library",
"license": "GPL-2.0-or-later",
"require": {
"automattic/jetpack-connection": "^1.58.2"
"automattic/jetpack-connection": "^1.58.3-alpha"
},
"require-dev": {
"automattic/wordbless": "@dev",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-my-jetpack/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"require": {
"automattic/jetpack-admin-ui": "^0.2.24",
"automattic/jetpack-assets": "^1.18.14-alpha",
"automattic/jetpack-connection": "^1.58.2",
"automattic/jetpack-connection": "^1.58.3-alpha",
"automattic/jetpack-jitm": "^2.5.2-alpha",
"automattic/jetpack-licensing": "^1.8.4",
"automattic/jetpack-plugins-installer": "^0.2.5",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-partner/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "jetpack-library",
"license": "GPL-2.0-or-later",
"require": {
"automattic/jetpack-connection": "^1.58.2",
"automattic/jetpack-connection": "^1.58.3-alpha",
"automattic/jetpack-status": "^1.18.5"
},
"require-dev": {
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-search/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "jetpack-library",
"license": "GPL-2.0-or-later",
"require": {
"automattic/jetpack-connection": "^1.58.2",
"automattic/jetpack-connection": "^1.58.3-alpha",
"automattic/jetpack-assets": "^1.18.14-alpha",
"automattic/jetpack-constants": "^1.6.23",
"automattic/jetpack-status": "^1.18.5",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-stats/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "GPL-2.0-or-later",
"require": {
"automattic/jetpack-assets": "^1.18.14-alpha",
"automattic/jetpack-connection": "^1.58.2",
"automattic/jetpack-connection": "^1.58.3-alpha",
"automattic/jetpack-constants": "^1.6.23",
"automattic/jetpack-status": "^1.18.5"
},
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-sync/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "jetpack-library",
"license": "GPL-2.0-or-later",
"require": {
"automattic/jetpack-connection": "^1.58.2",
"automattic/jetpack-connection": "^1.58.3-alpha",
"automattic/jetpack-constants": "^1.6.23",
"automattic/jetpack-identity-crisis": "^0.11.2-alpha",
"automattic/jetpack-password-checker": "^0.2.14",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/i18n-map.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
),
'jetpack-connection' => array(
'path' => 'jetpack_vendor/automattic/jetpack-connection',
'ver' => '1.58.2',
'ver' => '1.58.3-alpha1698929608',
),
'jetpack-idc' => array(
'path' => 'jetpack_vendor/automattic/jetpack-identity-crisis',
Expand Down
2 changes: 1 addition & 1 deletion vendor/automattic/jetpack-plans/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "library",
"license": "GPL-2.0-or-later",
"require": {
"automattic/jetpack-connection": "^1.58.2"
"automattic/jetpack-connection": "^1.58.3-alpha"
},
"require-dev": {
"yoast/phpunit-polyfills": "1.1.0",
Expand Down
Loading

0 comments on commit 8934605

Please sign in to comment.