diff options
author | admin <devnull@localhost> | 2006-10-31 01:36:32 +0100 |
---|---|---|
committer | admin <devnull@localhost> | 2006-10-31 01:36:32 +0100 |
commit | b93464db656fe017fe434b0fc917921ded88a12c (patch) | |
tree | 1ed24c1542b206a424e0b88e08f64a7932e31826 /system/libraries | |
parent | 784add749c806c52327615d47b8c6fabe2bd3438 (diff) |
Diffstat (limited to 'system/libraries')
-rw-r--r-- | system/libraries/Calendar.php | 11 | ||||
-rw-r--r-- | system/libraries/Pagination.php | 5 |
2 files changed, 14 insertions, 2 deletions
diff --git a/system/libraries/Calendar.php b/system/libraries/Calendar.php index 84b096c8b..fdef5dd75 100644 --- a/system/libraries/Calendar.php +++ b/system/libraries/Calendar.php @@ -45,7 +45,7 @@ class CI_Calendar { * * @access public */ - function CI_Calendar() + function CI_Calendar($config = array()) { $this->CI =& get_instance(); @@ -55,6 +55,12 @@ class CI_Calendar { } $this->local_time = time(); + + if (count($config) > 0) + { + $this->initialize($config); + } + log_message('debug', "Calendar Class Initialized"); } @@ -153,6 +159,9 @@ class CI_Calendar { // "previous" month link if ($this->show_next_prev == TRUE) { + // Add a trailing slash to the URL if needed + $this->next_prev_url = preg_replace("/(.+?)\/*$/", "\\1/", $this->next_prev_url); + $adjusted_date = $this->adjust_date($month - 1, $year); $out .= str_replace('{previous_url}', $this->next_prev_url.$adjusted_date['year'].'/'.$adjusted_date['month'], $this->temp['heading_previous_cell']); $out .= "\n"; diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php index c66d570cd..07ad6a683 100644 --- a/system/libraries/Pagination.php +++ b/system/libraries/Pagination.php @@ -120,8 +120,11 @@ class CI_Pagination { if ($CI->uri->segment($this->uri_segment) != 0) { $this->cur_page = $CI->uri->segment($this->uri_segment); + + // Prep the current page - no funny business! + $this->cur_page = preg_replace("/[a-z\-]/", "", $this->cur_page); } - + if ( ! is_numeric($this->cur_page)) { $this->cur_page = 0; |