-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: TypeError in form_open('') function #8729
Labels
bug
Verified issues on the current code behavior or pull requests that will fix them
Comments
bananacoffee
added
the
bug
Verified issues on the current code behavior or pull requests that will fix them
label
Apr 8, 2024
I could not reproduce. |
Cannot reproduce. |
I was able to confirm the reproducibility. // app\Config\Filters.php line 70
public array $globals = [
'before' => [
// 'honeypot',
'csrf',
// 'invalidchars',
],
'after' => [
'toolbar',
// 'honeypot',
// 'secureheaders',
],
]; Debug // vendor\codeigniter4\framework\system\Helpers\form_helper.php line 65
var_dump(in_array('csrf', $before, true)); // true
var_dump(array_key_exists('csrf', $before)); // false
var_dump(str_contains($action, base_url())); // error
if ((in_array('csrf', $before, true) || array_key_exists('csrf', $before)) && str_contains($action, base_url()) && !stripos($form, 'method="get"')) {
$form .= csrf_field($csrfId ?? null);
} |
It works when change it to
|
Check #8736 |
Resolved! |
No, not yet merged. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PHP Version
8.2
CodeIgniter4 Version
4.5.0
CodeIgniter4 Installation Method
Composer (as dependency to an existing project)
Which operating systems have you tested for this bug?
Windows
Which server did you use?
cli
Database
MariaDB 10.4
What happened?
When CSRF Filter is On.
I encountered a TypeError when using the form_open('').
The error message is as follows:
Debug
Steps to Reproduce
Expected Output
<form action="current_url" method="post">
Anything else?
This issue did not occur when using CodeIgniter version 4.4.7.
Any help on this issue would be greatly appreciated.
The text was updated successfully, but these errors were encountered: