Skip to content

Commit

Permalink
Custom CSS: prevent PHP warning (#38090)
Browse files Browse the repository at this point in the history
* Custom CSS: prevent PHP warning

* Update condition

* Bump versions
  • Loading branch information
monsieur-z committed Jun 28, 2024
1 parent 84d3de2 commit 3b7d354
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: fixed
Comment: Prevent PHP warning


2 changes: 1 addition & 1 deletion projects/packages/jetpack-mu-wpcom/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-mu-wpcom",
"version": "5.41.0",
"version": "5.41.1-alpha",
"description": "Enhances your site with features powered by WordPress.com",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/jetpack-mu-wpcom/#readme",
"bugs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Jetpack_Mu_Wpcom main class.
*/
class Jetpack_Mu_Wpcom {
const PACKAGE_VERSION = '5.41.0';
const PACKAGE_VERSION = '5.41.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 @@ -632,12 +632,12 @@ public static function explode_ws( $sep, $string ) {
* @see dissolve_4value_shorthands()
*/
public static function merge_4value_shorthands( $array ) {
$return = $array;
$return = is_array( $array ) ? $array : array();
$shorthands = & $GLOBALS['csstidy']['shorthands'];

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

$important = '';
Expand Down
5 changes: 5 additions & 0 deletions projects/plugins/jetpack/changelog/fix-css-tidy-wraning
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: other
Comment: Prevent PHP warning


Original file line number Diff line number Diff line change
Expand Up @@ -632,12 +632,12 @@ public static function explode_ws( $sep, $string ) {
* @see dissolve_4value_shorthands()
*/
public static function merge_4value_shorthands( $array ) {
$return = $array;
$return = is_array( $array ) ? $array : array();
$shorthands = & $GLOBALS['csstidy']['shorthands'];

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

$important = '';
Expand Down

0 comments on commit 3b7d354

Please sign in to comment.