1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 05:37:32 +02:00

Additional parameter vetting

This commit is contained in:
e107steved
2007-12-03 20:38:13 +00:00
parent 833a7cedd0
commit d75e047a10
2 changed files with 19 additions and 14 deletions

View File

@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_plugins/blogcalendar_menu/archive.php,v $ | $Source: /cvs_backup/e107_0.8/e107_plugins/blogcalendar_menu/archive.php,v $
| $Revision: 1.2 $ | $Revision: 1.3 $
| $Date: 2007-05-13 13:59:25 $ | $Date: 2007-12-03 20:38:01 $
| $Author: e107steved $ | $Author: e107steved $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
| Based on code by: Thomas Bouve (crahan@gmx.net) | Based on code by: Thomas Bouve (crahan@gmx.net)
@@ -50,12 +50,17 @@ $pref['blogcal_ws'] = "monday";
$cur_year = date("Y"); $cur_year = date("Y");
$cur_month = date("n"); $cur_month = date("n");
$cur_day = date("j"); $cur_day = date("j");
if (strstr(e_QUERY, "year")) { if (strstr(e_QUERY, "year"))
{
$tmp = explode(".", e_QUERY); $tmp = explode(".", e_QUERY);
$req_year = $tmp[1]; if (is_numeric($tmp[1]))
} else { {
$req_year = $cur_year; $req_year = intval($tmp[1]);
} }
}
if (!isset($req_year)) $req_year = $cur_year;
// -------------------------------- // --------------------------------

View File

@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_plugins/blogcalendar_menu/blogcalendar_menu.php,v $ | $Source: /cvs_backup/e107_0.8/e107_plugins/blogcalendar_menu/blogcalendar_menu.php,v $
| $Revision: 1.1.1.1 $ | $Revision: 1.2 $
| $Date: 2006-12-02 04:34:44 $ | $Date: 2007-12-03 20:38:01 $
| $Author: mcfly_e107 $ | $Author: e107steved $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
| Based on code by: Thomas Bouve (crahan@gmx.net) | Based on code by: Thomas Bouve (crahan@gmx.net)
*/ */
@@ -38,8 +38,8 @@ list($cur_year, $cur_month, $cur_day) = explode(" ", date("Y n j"));
if (strstr(e_QUERY, "day")) { if (strstr(e_QUERY, "day")) {
$tmp = explode(".", e_QUERY); $tmp = explode(".", e_QUERY);
$item = $tmp[1]; $item = $tmp[1];
$req_year = substr($item, 0, 4); $req_year = intval(substr($item, 0, 4));
$req_month = substr($item, 4, 2); $req_month = intval(substr($item, 4, 2));
// decide on the behaviour here, do we highlight // decide on the behaviour here, do we highlight
// the day being viewed? or only 'today'? // the day being viewed? or only 'today'?
//$req_day = substr($item, 6, 2); //$req_day = substr($item, 6, 2);
@@ -54,8 +54,8 @@ if (strstr(e_QUERY, "day")) {
else if(strstr(e_QUERY, "month")) { else if(strstr(e_QUERY, "month")) {
$tmp = explode(".", e_QUERY); $tmp = explode(".", e_QUERY);
$item = $tmp[1]; $item = $tmp[1];
$req_year = substr($item, 0, 4); $req_year = intval(substr($item, 0, 4));
$req_month = substr($item, 4, 2); $req_month = intval(substr($item, 4, 2));
// if the requested year and month are the current, then add // if the requested year and month are the current, then add
// the current day to the mix so the calendar highlights it // the current day to the mix so the calendar highlights it
if (($req_year == $cur_year) && ($req_month == $cur_month)) { if (($req_year == $cur_year) && ($req_month == $cur_month)) {