Commit eabfce11 authored by Kevin Paxman's avatar Kevin Paxman
Browse files

Correct undefined index errors in select cases

parent ce5bb763
......@@ -27,11 +27,11 @@ $query = drupal_get_query_parameters();
$start_date = !empty($query['mini']) ? $query['mini'] : date('Y-m', strtotime($min_date_formatted));
if ($start_date != date('Y-m')) {
$path = current_path();
if (preg_match('/^[0-9]{4}-(0?[1-9]|1[0-2])(-[0-9]+)$/', $query['mini'])) {
if (!empty($query['mini']) && preg_match('/^[0-9]{4}-(0?[1-9]|1[0-2])(-[0-9]+)$/', $query['mini'])) {
//valid date, but for a specific day, and we only want this to the month level
$query['mini'] = date('Y-m', strtotime($query['mini']));
drupal_goto($path, array('query' => $query));
} elseif (!preg_match('/^[0-9]{4}-(0?[1-9]|1[0-2])$/', $query['mini']) || !$start_date) {
} elseif (!empty($query['mini']) && !preg_match('/^[0-9]{4}-(0?[1-9]|1[0-2])$/', $query['mini']) || !$start_date) {
//invalid date format, go to current month
$query['mini'] = date('Y-m'); //do this instead of unsetting $query['mini'] so that this will still work on big calendar pages not in the current month
drupal_goto($path, array('query' => $query));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment