summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--application/config/user_agents.php5
-rwxr-xr-xsystem/helpers/url_helper.php8
-rw-r--r--system/libraries/Email.php10
-rw-r--r--user_guide_src/source/helpers/url_helper.rst21
-rw-r--r--user_guide_src/source/tutorial/static_pages.rst4
5 files changed, 29 insertions, 19 deletions
diff --git a/application/config/user_agents.php b/application/config/user_agents.php
index cddb01da9..721ce413d 100644
--- a/application/config/user_agents.php
+++ b/application/config/user_agents.php
@@ -151,7 +151,10 @@ $mobiles = array(
'spv' => "SPV",
'zte' => "ZTE",
'sendo' => "Sendo",
-
+ 'dsi' => "Nintendo DSi",
+ 'ds' => "Nintendo DS",
+ 'wii' => "Nintendo Wii",
+ '3ds' => "Nintendo 3DS",
// Operating Systems
'android' => "Android",
'symbian' => "Symbian",
diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php
index bfed96c6e..5d907d00e 100755
--- a/system/helpers/url_helper.php
+++ b/system/helpers/url_helper.php
@@ -544,13 +544,19 @@ if ( ! function_exists('url_title'))
*/
if ( ! function_exists('redirect'))
{
- function redirect($uri = '', $method = 'location', $http_response_code = 302)
+ function redirect($uri = '', $method = 'auto', $http_response_code = 302)
{
if ( ! preg_match('#^https?://#i', $uri))
{
$uri = site_url($uri);
}
+ // IIS environment likely? Use 'refresh' for better compatibility
+ if (DIRECTORY_SEPARATOR != '/' && $method == 'auto')
+ {
+ $method = 'refresh';
+ }
+
switch($method)
{
case 'refresh' : header("Refresh:0;url=".$uri);
diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index db6ea8f90..6739db33b 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -1718,12 +1718,12 @@ class CI_Email {
$this->_send_command('hello');
$this->_send_command('starttls');
$crypto = stream_socket_enable_crypto($this->_smtp_connect, TRUE, STREAM_CRYPTO_METHOD_TLS_CLIENT);
- }
- if ($crypto !== TRUE)
- {
- $this->_set_error_message('lang:email_smtp_error', $this->_get_smtp_data());
- return FALSE;
+ if ($crypto !== TRUE)
+ {
+ $this->_set_error_message('lang:email_smtp_error', $this->_get_smtp_data());
+ return FALSE;
+ }
}
return $this->_send_command('hello');
diff --git a/user_guide_src/source/helpers/url_helper.rst b/user_guide_src/source/helpers/url_helper.rst
index c72558705..e6d51b22b 100644
--- a/user_guide_src/source/helpers/url_helper.rst
+++ b/user_guide_src/source/helpers/url_helper.rst
@@ -284,23 +284,24 @@ redirect()
==========
Does a "header redirect" to the URI specified. If you specify the full
-site URL that link will be build, but for local links simply providing
+site URL that link will be built, but for local links simply providing
the URI segments to the controller you want to direct to will create the
link. The function will build the URL based on your config file values.
-The optional second parameter allows you to choose between the
-"location" method (default) or the "refresh" method. Location is faster,
-but on Windows servers it can sometimes be a problem. The optional third
-parameter allows you to send a specific HTTP Response Code - this could
-be used for example to create 301 redirects for search engine purposes.
-The default Response Code is 302. The third parameter is *only*
-available with 'location' redirects, and not 'refresh'. Examples
+The optional second parameter allows you to force a particular redirection
+method. The available methods are "location" or "refresh", with location
+being faster but less reliable on Windows servers. The default is "auto",
+which will attempt to intelligently choose the method based on the server
+environment.
-::
+The optional third parameter allows you to send a specific HTTP Response
+Code - this could be used for example to create 301 redirects for search
+engine purposes. The default Response Code is 302. The third parameter is
+*only* available with 'location' redirects, and not 'refresh'. Examples::
if ($logged_in == FALSE)
{      
- redirect('/login/form/', 'refresh');
+ redirect('/login/form/');
}
// with 301 redirect
diff --git a/user_guide_src/source/tutorial/static_pages.rst b/user_guide_src/source/tutorial/static_pages.rst
index 0bbf51b1b..82de2a8cb 100644
--- a/user_guide_src/source/tutorial/static_pages.rst
+++ b/user_guide_src/source/tutorial/static_pages.rst
@@ -28,7 +28,7 @@ code.
<?php
class Pages extends CI_Controller {
- public function view($page == 'home')
+ public function view($page = 'home')
{
}
@@ -62,7 +62,7 @@ following code.
</head>
<body>
- <h1>CodeIgniter 2 Tutorial<h1>
+ <h1>CodeIgniter 2 Tutorial</h1>
The header contains the basic HTML code that you'll want to display
before loading the main view, together with a heading. It will also