summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/helpers/form_helper.php4
-rw-r--r--user_guide/changelog.html2
-rw-r--r--user_guide/libraries/input.html6
3 files changed, 11 insertions, 1 deletions
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php
index 532309794..8aa788c6c 100644
--- a/system/helpers/form_helper.php
+++ b/system/helpers/form_helper.php
@@ -49,11 +49,15 @@ if ( ! function_exists('form_open'))
$attributes = 'method="post"';
}
+ // If an action is not a full URL then turn it into one
if ($action && strpos($action, '://') === FALSE)
{
$action = $CI->config->site_url($action);
}
+ // If no action is provided then set to the current url
+ $action OR $action = $CI->config->site_url($CI->uri->uri_string());
+
$form = '<form action="'.$action.'"';
$form .= _attributes_to_string($attributes, TRUE);
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index b1900301a..8335822b0 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -83,8 +83,10 @@ Hg Tag: n/a</p>
<li class="reactor">Fixed a bug (Reactor #145) where the Output Library had parse_exec_vars set to protected.</li>
<li class="reactor">Fixed a bug (Reactor #80) where is_really_writable would create an empty file when on Windows or with safe_mode enabled.</li>
<li class="reactor">Fixed various bugs with User Guide.</li>
+ <li class="reactor">Added is_cli_request() method to documentation for <a href="libraries/input.html">Input class</a>.</li>
<li class="reactor">Added form_validation_lang entries for <kbd>decimal</kbd>, <kbd>less_than</kbd> and <kbd>greater_than</kbd>.</li>
<li class="reactor"><a href="https://bitbucket.org/ellislab/codeigniter-reactor/issue/153/escape-str-bug-in-mssql-driver">Fixed issue #153</a> Escape Str Bug in MSSQL driver.</li>
+ <li class="reactor"><a href="https://bitbucket.org/ellislab/codeigniter-reactor/issue/172/bug-in-chrome-and-form_open-in-201">Fixed issue #172</a> Google Chrome 11 posts incorrectly when action is empty.</li>
</ul>
<h2>Version 2.0.1</h2>
diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html
index d7e898bd1..b34938b13 100644
--- a/user_guide/libraries/input.html
+++ b/user_guide/libraries/input.html
@@ -269,7 +269,11 @@ else<br />
<h2>$this->input->is_ajax_request()</h2>
<p>Checks to see if the <var>HTTP_X_REQUESTED_WITH</var> server header has been set, and returns a boolean response.</p>
-<code>$this->input->is_ajax_request()</code>
+
+<h2>$this->input->is_cli_request()</h2>
+<p>Checks to see if the <var>STDIN</var> constant is set, which is a failsafe way to see if PHP is being run on the command line.</p>
+
+<code>$this->input->is_cli_request()</code>
</div>