Changeset 611

Show
Ignore:
Timestamp:
09/29/2007 12:20:20 AM (14 months ago)
Author:
Geert
Message:

Fix uri->last_segment() to prevent possible undefined offset errors

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/libraries/URI.php

    r609 r611  
    9898         * 
    9999         * @access      public 
     100         * @param       mixed 
    100101         * @return      string 
    101102         */ 
    102         public function last_segment() 
     103        public function last_segment($default = FALSE) 
    103104        { 
     105                if ($this->total_segments() < 1) 
     106                        return $default; 
     107                 
    104108                return self::$segments[$this->total_segments() - 1]; 
    105109        }