From 17a890df20b56c8d82812f365f27bc590be009f3 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 27 Sep 2006 20:42:42 +0000 Subject: --- system/application/config/autoload.php | 16 ---------------- system/application/config/database.php | 2 +- system/database/drivers/mysql/mysql_driver.php | 14 +++++++++++++- system/database/drivers/mysqli/mysqli_driver.php | 14 +++++++++++++- system/libraries/Router.php | 20 +++++++++++++++++--- user_guide/database/active_record.html | 4 ++-- user_guide/database/caching.html | 4 ++-- user_guide/database/call_function.html | 4 ++-- user_guide/database/configuration.html | 4 ++-- user_guide/database/connecting.html | 4 ++-- user_guide/database/examples.html | 4 ++-- user_guide/database/export.html | 4 ++-- user_guide/database/fields.html | 4 ++-- user_guide/database/helpers.html | 4 ++-- user_guide/database/index.html | 4 ++-- user_guide/database/queries.html | 4 ++-- user_guide/database/results.html | 4 ++-- user_guide/database/table_data.html | 4 ++-- user_guide/database/transactions.html | 4 ++-- user_guide/database/utilities.html | 4 ++-- user_guide/general/alternative_php.html | 4 ++-- user_guide/general/ancillary_classes.html | 4 ++-- user_guide/general/autoloader.html | 5 ++--- user_guide/general/caching.html | 4 ++-- user_guide/general/changelog.html | 5 +++-- user_guide/general/controllers.html | 4 ++-- user_guide/general/core_classes.html | 4 ++-- user_guide/general/creating_libraries.html | 4 ++-- user_guide/general/credits.html | 4 ++-- user_guide/general/errors.html | 4 ++-- user_guide/general/helpers.html | 4 ++-- user_guide/general/hooks.html | 8 ++++---- user_guide/general/index.html | 4 ++-- user_guide/general/libraries.html | 6 +++--- user_guide/general/models.html | 4 ++-- user_guide/general/multiple_apps.html | 10 +++++----- user_guide/general/plugins.html | 4 ++-- user_guide/general/quick_reference.html | 4 ++-- user_guide/general/requirements.html | 4 ++-- user_guide/general/routing.html | 4 ++-- user_guide/general/scaffolding.html | 4 ++-- user_guide/general/security.html | 4 ++-- user_guide/general/urls.html | 4 ++-- user_guide/general/views.html | 4 ++-- user_guide/helpers/array_helper.html | 4 ++-- user_guide/helpers/cookie_helper.html | 4 ++-- user_guide/helpers/date_helper.html | 4 ++-- user_guide/helpers/directory_helper.html | 4 ++-- user_guide/helpers/file_helper.html | 4 ++-- user_guide/helpers/form_helper.html | 4 ++-- user_guide/helpers/html_helper.html | 4 ++-- user_guide/helpers/index.html | 4 ++-- user_guide/helpers/inflector_helper.html | 4 ++-- user_guide/helpers/security_helper.html | 4 ++-- user_guide/helpers/string_helper.html | 4 ++-- user_guide/helpers/text_helper.html | 4 ++-- user_guide/helpers/typography_helper.html | 4 ++-- user_guide/helpers/url_helper.html | 4 ++-- user_guide/helpers/xml_helper.html | 4 ++-- user_guide/index.html | 4 ++-- user_guide/installation/downloads.html | 4 ++-- user_guide/installation/index.html | 18 ++---------------- user_guide/installation/upgrade_120.html | 4 ++-- user_guide/installation/upgrade_130.html | 4 ++-- user_guide/installation/upgrade_131.html | 4 ++-- user_guide/installation/upgrade_132.html | 4 ++-- user_guide/installation/upgrade_133.html | 4 ++-- user_guide/installation/upgrade_140.html | 4 ++-- user_guide/installation/upgrade_141.html | 4 ++-- user_guide/installation/upgrade_b11.html | 4 ++-- user_guide/installation/upgrading.html | 6 +++--- user_guide/libraries/benchmark.html | 4 ++-- user_guide/libraries/calendar.html | 4 ++-- user_guide/libraries/config.html | 4 ++-- user_guide/libraries/email.html | 4 ++-- user_guide/libraries/encryption.html | 4 ++-- user_guide/libraries/file_uploading.html | 4 ++-- user_guide/libraries/image_lib.html | 4 ++-- user_guide/libraries/input.html | 4 ++-- user_guide/libraries/language.html | 4 ++-- user_guide/libraries/loader.html | 4 ++-- user_guide/libraries/output.html | 4 ++-- user_guide/libraries/pagination.html | 4 ++-- user_guide/libraries/parser.html | 4 ++-- user_guide/libraries/sessions.html | 4 ++-- user_guide/libraries/trackback.html | 4 ++-- user_guide/libraries/unit_testing.html | 4 ++-- user_guide/libraries/uri.html | 4 ++-- user_guide/libraries/validation.html | 4 ++-- user_guide/libraries/xmlrpc.html | 4 ++-- user_guide/license.html | 4 ++-- user_guide/overview/appflow.html | 4 ++-- user_guide/overview/at_a_glance.html | 4 ++-- user_guide/overview/features.html | 4 ++-- user_guide/overview/goals.html | 4 ++-- user_guide/overview/index.html | 4 ++-- user_guide/overview/mvc.html | 4 ++-- user_guide/scripts/nav.js | 1 + user_guide/toc.html | 7 ++++--- 99 files changed, 241 insertions(+), 231 deletions(-) diff --git a/system/application/config/autoload.php b/system/application/config/autoload.php index fc9d43fb6..245d36a7c 100644 --- a/system/application/config/autoload.php +++ b/system/application/config/autoload.php @@ -21,7 +21,6 @@ | 1. Libraries | 2. Helper files | 3. Plugins -| 4. Scripts | 5. Custom config files | */ @@ -65,21 +64,6 @@ $autoload['helper'] = array(); $autoload['plugin'] = array(); -/* -| ------------------------------------------------------------------- -| Auto-load Scripts -| ------------------------------------------------------------------- -| The term "scripts" refers to you own PHP scripts that you've -| placed in the application/scripts/ folder -| -| Prototype: -| -| $autoload['script'] = array('my_script1', 'my_script2'); -*/ - -$autoload['script'] = array(); - - /* | ------------------------------------------------------------------- | Auto-load Config files diff --git a/system/application/config/database.php b/system/application/config/database.php index 204ef6894..5e6420831 100644 --- a/system/application/config/database.php +++ b/system/application/config/database.php @@ -34,7 +34,7 @@ $active_group = "default"; $db['default']['hostname'] = "localhost"; $db['default']['username'] = "root"; $db['default']['password'] = ""; -$db['default']['database'] = "test"; +$db['default']['database'] = "tester"; $db['default']['dbdriver'] = "mysql"; $db['default']['dbprefix'] = ""; $db['default']['active_r'] = TRUE; diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index b6c4eb7ea..d4f322d5f 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -222,7 +222,19 @@ class CI_DB_mysql_driver extends CI_DB { */ function escape_str($str) { - return mysql_real_escape_string($str); + if (get_magic_quotes_gpc()) + { + return $str; + } + + if (function_exists('mysql_escape_string')) + { + return mysql_real_escape_string($str); + } + else + { + return addslashes($str); + } } // -------------------------------------------------------------------- diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index d6e967498..63df0fe6f 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -225,7 +225,19 @@ class CI_DB_mysqli_driver extends CI_DB { */ function escape_str($str) { - return mysqli_real_escape_string($this->conn_id, $str); + if (get_magic_quotes_gpc()) + { + return $str; + } + + if (function_exists('mysql_escape_string')) + { + return mysqli_real_escape_string($this->conn_id, $str); + } + else + { + return addslashes($str); + } } // -------------------------------------------------------------------- diff --git a/system/libraries/Router.php b/system/libraries/Router.php index d7740f5f3..34a2512a6 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -65,7 +65,9 @@ class CI_Router { */ function _set_route_mapping() { - // Are query strings enabled? If so we're done... + + // Are query strings enabled in the config file? + // If so, we're done since segment based URIs are not used with query strings. if ($this->config->item('enable_query_strings') === TRUE AND isset($_GET[$this->config->item('controller_trigger')])) { $this->set_class($_GET[$this->config->item('controller_trigger')]); @@ -78,15 +80,26 @@ class CI_Router { return; } - // Load the routes.php file and set the default controller + // Load the routes.php file. @include_once(APPPATH.'config/routes'.EXT); $this->routes = ( ! isset($route) OR ! is_array($route)) ? array() : $route; unset($route); + // Set the default controller so we can display it in the event + // the URI doesn't correlated to a valid controller. $this->default_controller = ( ! isset($this->routes['default_controller']) OR $this->routes['default_controller'] == '') ? FALSE : strtolower($this->routes['default_controller']); + // Fetch the complete URI string + $this->uri_string = $this->_get_uri_string(); + + // If the URI contains only a slash we'll kill it + if ($this->uri_string == '/') + { + $this->uri_string = ''; + } + // Is there a URI string? If not, the default controller specified in the "routes" file will be shown. - if (($this->uri_string = $this->_get_uri_string()) == '') + if ($this->uri_string == '') { if ($this->default_controller === FALSE) { @@ -107,6 +120,7 @@ class CI_Router { $this->uri_string = preg_replace("|".preg_quote($this->config->item('url_suffix'))."$|", "", $this->uri_string); } + // Explode the URI Segments. The individual segments will // be stored in the $this->segments array. foreach(explode("/", preg_replace("|/*(.+?)/*$|", "\\1", $this->uri_string)) as $val) diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index b87f6f731..caa4c95a6 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -7,9 +7,9 @@ - + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - +