From 3cafd12137e9e27d75e70d3aa433c28f30475594 Mon Sep 17 00:00:00 2001 From: Mykyta Synelnikov Date: Fri, 5 Sep 2025 15:24:28 +0300 Subject: [PATCH] Fix invalid 'start_of_week' handling in weekly events logic Ensure 'start_of_week' option is validated as numeric to prevent incorrect calculations. This fixes potential issues when non-numeric values are stored in the option. --- includes/core/class-cron.php | 4 +++- readme.txt | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/core/class-cron.php b/includes/core/class-cron.php index 63b0ad34..34244c41 100644 --- a/includes/core/class-cron.php +++ b/includes/core/class-cron.php @@ -80,7 +80,9 @@ if ( ! class_exists( 'um\core\Cron' ) ) { */ private function weekly_events() { $sunday_start = wp_date( 'w' ); - $week_start = $sunday_start - absint( get_option( 'start_of_week' ) ); + $start_of_week = get_option( 'start_of_week', 0 ); + $start_of_week = is_numeric( $start_of_week ) ? $start_of_week : 0; + $week_start = $sunday_start - absint( $start_of_week ); $week_start_day = strtotime( '-' . $week_start . ' days' ); $time = mktime( 0, 0, 0, wp_date( 'm', $week_start_day ), wp_date( 'd', $week_start_day ), wp_date( 'Y', $week_start_day ) ); if ( ! wp_next_scheduled( 'um_weekly_scheduled_events' ) ) { diff --git a/readme.txt b/readme.txt index 2ca70b34..03c62e0c 100644 --- a/readme.txt +++ b/readme.txt @@ -178,6 +178,8 @@ IMPORTANT: PLEASE UPDATE THE PLUGIN TO AT LEAST VERSION 2.6.7 IMMEDIATELY. VERSI **Bugfixes** * Fixed: Changed the view and the edit user profile links in the comments section on the frontend. +* Fixed: `Contains` conditional logic operand when value is array. +* Fixed: Integer validation for the 'start_of_week' WP native setting. = 2.10.5 2025-06-25 =