From 8772e62fe2feab4432fc811e7fb60f0a0ee85db2 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Tue, 6 Jul 2010 21:33:42 +0000 Subject: [PATCH] Additonal sql injection prevention in date2sql(). --- CHANGELOG.txt | 4 ++++ includes/date_functions.inc | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index a157232..ec4587d 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,10 @@ Legend: ! -> Note $ -> Affected files +06-Jul-2010 Janusz Dobrowolski/Micha³ Kozielski +# Additional sql injection prevention. +$ /includes/date_functions.inc + ------------------------------- Release 2.2.11 ---------------------------------- ! Release 2.2.11 $ config.default.php diff --git a/includes/date_functions.inc b/includes/date_functions.inc index 0adac04..bf579a4 100644 --- a/includes/date_functions.inc +++ b/includes/date_functions.inc @@ -328,7 +328,11 @@ and converts to a yyyy/mm/dd format */ else // $how == 2, YYYYMMDD list($year, $month, $day) = explode($sep, $date_); -//to modify assumption in 2030 + // prevent potential SQL injection + $year = (int)$year; + $month = (int)$month; + $day = (int)$day; + //to modify assumption in 2030 if ($date_system == 0 || $date_system == 3) { if ((int)$year < 60) -- 2.30.2