Skip to content

Commit

Permalink
Jetpack-mu-wpcom: prevent PHP warnings (#39446)
Browse files Browse the repository at this point in the history
  • Loading branch information
monsieur-z authored and matticbot committed Sep 19, 2024
1 parent 3113d21 commit 956ed71
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 96 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "wordpress-plugin",
"license": "GPL-2.0-or-later",
"require": {
"automattic/jetpack-mu-wpcom": "^5.63.0"
"automattic/jetpack-mu-wpcom": "^5.63.1-alpha"
},
"require-dev": {
"yoast/phpunit-polyfills": "^1.1.1",
Expand Down
58 changes: 29 additions & 29 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions vendor/automattic/jetpack-mu-wpcom/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ 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).

## [5.63.1-alpha] - unreleased

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

## [5.63.0] - 2024-09-18
### Added
- Added a shopping cart icon to the masterbar. This icon will be displayed when the user has items in the cart and liks to the checkout page. [#39298]
Expand Down Expand Up @@ -1238,6 +1242,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Testing initial package release.

[5.63.1-alpha]: https://github.com/Automattic/jetpack-mu-wpcom/compare/v5.63.0...v5.63.1-alpha
[5.63.0]: https://github.com/Automattic/jetpack-mu-wpcom/compare/v5.62.0...v5.63.0
[5.62.0]: https://github.com/Automattic/jetpack-mu-wpcom/compare/v5.61.0...v5.62.0
[5.61.0]: https://github.com/Automattic/jetpack-mu-wpcom/compare/v5.60.0...v5.61.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* Jetpack_Mu_Wpcom main class.
*/
class Jetpack_Mu_Wpcom {
const PACKAGE_VERSION = '5.63.0';
const PACKAGE_VERSION = '5.63.1-alpha';
const PKG_DIR = __DIR__ . '/../';
const BASE_DIR = __DIR__ . '/';
const BASE_FILE = __FILE__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,18 +298,22 @@ public function cut_color( $color ) {
for ( $i = 0, $l = count( $color_tmp ); $i < $l; $i++ ) {
$color_tmp[ $i ] = trim( $color_tmp[ $i ] );
if ( str_ends_with( $color_tmp[ $i ], '%' ) ) {
$color_tmp[ $i ] = round( ( 255 * $color_tmp[ $i ] ) / 100 );
$color_tmp[ $i ] = round( ( 255 * (int) substr( $color_tmp[ $i ], 0, -1 ) ) / 100 );
}
if ( $color_tmp[ $i ] > 255 ) {
$color_tmp[ $i ] = 255;
}
}
$color = '#';
for ( $i = 0; $i < 3; $i++ ) {
if ( $color_tmp[ $i ] < 16 ) {
$color .= '0' . dechex( $color_tmp[ $i ] );
} else {
$color .= dechex( $color_tmp[ $i ] );

if ( count( $color_tmp ) >= 3 ) {
$color = '#';

for ( $i = 0; $i < 3; $i++ ) {
if ( $color_tmp[ $i ] < 16 ) {
$color .= '0' . dechex( $color_tmp[ $i ] );
} else {
$color .= dechex( $color_tmp[ $i ] );
}
}
}
}
Expand Down Expand Up @@ -636,8 +640,11 @@ public static function merge_4value_shorthands( $array ) {
$shorthands = & $GLOBALS['csstidy']['shorthands'];

foreach ( $shorthands as $key => $value ) {
if ( $value !== 0 && isset( $array[ $value[0] ] ) && isset( $array[ $value[1] ] )
&& isset( $array[ $value[2] ] ) && isset( $array[ $value[3] ] ) ) {
if ( $value === 0 || ( is_array( $value ) && count( $value ) < 4 ) ) {
continue;
}

if ( isset( $array[ $value[0] ] ) && isset( $array[ $value[1] ] ) && isset( $array[ $value[2] ] ) && isset( $array[ $value[3] ] ) ) {
$return[ $key ] = '';

$important = '';
Expand Down
Loading

0 comments on commit 956ed71

Please sign in to comment.