diff --git a/src/generators/schema/howto.php b/src/generators/schema/howto.php index 7319cf7a400..43d1ae766bc 100644 --- a/src/generators/schema/howto.php +++ b/src/generators/schema/howto.php @@ -46,9 +46,9 @@ private function add_duration( &$data, $attributes ) { return; } - $days = empty( $attributes['days'] ) ? 0 : $attributes['days']; - $hours = empty( $attributes['hours'] ) ? 0 : $attributes['hours']; - $minutes = empty( $attributes['minutes'] ) ? 0 : $attributes['minutes']; + $days = \intval( ( $attributes['days'] ?? 0 ) ); + $hours = \intval( ( $attributes['hours'] ?? 0 ) ); + $minutes = \intval( ( $attributes['minutes'] ?? 0 ) ); if ( ( $days + $hours + $minutes ) > 0 ) { $data['totalTime'] = \esc_attr( 'P' . $days . 'DT' . $hours . 'H' . $minutes . 'M' );