Show
Ignore:
Timestamp:
12/14/2007 05:41:26 PM (13 months ago)
Author:
Shadowhand
Message:

Updates to Router/URI:

  • Remove Router::$query_string setup routine from URI::construct
  • Re-enabled the GET key optimization
Files:
1 modified

Legend:

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

    r1522 r1539  
    1111 
    1212        /** 
    13          * Constructor: __construct 
    14          *  Detects current query string. 
     13         * Constructor. 
    1514         */ 
    1615        public function __construct() 
    1716        { 
    18                 if ( ! empty($_GET)) 
    19                 { 
    20                         self::$query_string = '?'; 
    21  
    22                         foreach($_GET as $key => $val) 
    23                         { 
    24                                 if (is_array($val)) 
    25                                 { 
    26                                         foreach($val as $sub_key => $sub_val) 
    27                                         { 
    28                                                 // Integer subkeys are numerically indexed arrays 
    29                                                 $sub_key = is_int($sub_key) ? '[]' : '['.$sub_key.']'; 
    30  
    31                                                 self::$query_string .= $key.rawurlencode($sub_key).'='.rawurlencode($sub_val).'&'; 
    32                                         } 
    33                                 } 
    34                                 else 
    35                                 { 
    36                                         self::$query_string .= $key.'='.rawurlencode($val).'&'; 
    37                                 } 
    38                         } 
    39  
    40                         // Remove the ending ampersand 
    41                         self::$query_string = rtrim(self::$query_string, '&'); 
    42                 } 
     17                Log::add('debug', 'URI library initialized.'); 
    4318        } 
    4419