Skip to content

form_input double escaping data why ? #2405

Closed
@crustamet

Description

@crustamet

hello i use this function form_input from the form helper like this, i don't know what i am doing wrong and don`t know if this is a bug or not but please test this.

$input_attrs = array();
$input_attrs['name'] = 'contact_name';
$input_attrs['type'] = 'text';
$input_attrs['value'] = set_value('contact_name');

echo form_input($input_attrs);

and when i put this value in the input

<script>alert("test")</script>

it returns this :

&amp;lt;script&amp;gt;alert(&amp;quot;test&amp;quot;)&amp;lt;/script&amp;gt;

instead of :

&lt;script&gt;alert(&quot;test&quot;)&lt;/script&gt;

But when i use without the form_input function and use it like this

<input type="text" name="contact_name" value="<?=set_value('contact_name')?>">

it returns good escaped data

&lt;script&gt;alert(&quot;test&quot;)&lt;/script&gt;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugVerified issues on the current code behavior or pull requests that will fix them

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions