Skip to content
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

Uses csrf_field and form_hidden instead of inline-html in form_open #1633

Merged
merged 9 commits into from
Jan 2, 2019
Prev Previous commit
Next Next commit
Update form_helper.php
  • Loading branch information
nowackipawel authored Dec 31, 2018
commit 2c1ebbbbea8e51fd3f0e40eee8bb6bb91bc96d93
4 changes: 2 additions & 2 deletions system/Helpers/form_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function form_open(string $action = '', $attributes = [], array $hidden = []): s

if(is_array($attributes) && array_key_exists('csrf_id', $attributes))
{
$csrf_id = $attributes['csrf_id'];
$csrfId = $attributes['csrf_id'];
unset($attributes['csrf_id']);
}

Expand All @@ -90,7 +90,7 @@ function form_open(string $action = '', $attributes = [], array $hidden = []): s

if ((in_array('csrf', $before) || array_key_exists('csrf', $before)) && strpos($action, base_url()) !== false && ! stripos($form, 'method="get"'))
{
$form .= csrf_field($csrf_id ?? null);
$form .= csrf_field($csrfId ?? null);
}

if (is_array($hidden))
Expand Down