From e04497be7907a8839834813f651b38f353a47ff9 Mon Sep 17 00:00:00 2001
From: Lee Maguire <lee@dxw.com>
Date: Tue, 23 Jul 2024 18:14:39 +0100
Subject: [PATCH] Ensure month is in the range 01 to 12
If the variable `$thismonth` contains a value other than a valid month,
the subsequent SQL query will raise an error.
---
wp-includes/general-template.php | 3 +++
1 file changed, 3 insertions(+)
diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php
index bf70defd..6e63a8d1 100644
a
|
b
|
function get_calendar( $initial = true, $display = true ) { |
2300 | 2300 | $thismonth = '01'; |
2301 | 2301 | } else { |
2302 | 2302 | $thismonth = zeroise( (int) substr( $m, 4, 2 ), 2 ); |
| 2303 | if ( ! in_array( (int) $thismonth, range(1,12) ) ) { |
| 2304 | $thismonth = '01'; |
| 2305 | } |
2303 | 2306 | } |
2304 | 2307 | } else { |
2305 | 2308 | $thisyear = current_time( 'Y' ); |