Editor: Prevent PHP warning when parsing duotone hue values.

Props jacobcassidy, rahmohn, mukesh27.
Fixes #59496.

git-svn-id: https://develop.svn.wordpress.org/trunk@57652 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Pascal Birchler
2024-02-18 14:57:23 +00:00
parent a1d6aa3644
commit ba644b94df
2 changed files with 30 additions and 5 deletions

View File

@@ -209,10 +209,7 @@ class WP_Duotone {
'rad' => 360 / ( M_PI * 2 ),
);
$factor = $angle_units[ $unit ];
if ( ! $factor ) {
$factor = 1;
}
$factor = isset( $angle_units[ $unit ] ) ? $angle_units[ $unit ] : 1;
return (float) $value * $factor;
}