Note that there are some explanatory texts on larger screens.

plurals
  1. POprevent array in string field - XSS
    primarykey
    data
    text
    <p>I'm having trouble analyzing input forms...<br> I will give three examples , both taking into account the change of the form 'User'</p> <hr> <pre><code>&lt;form method="POST" action="#"&gt; &lt;input type="text" name="first_name" value="Albert"&gt; &lt;input type="text" name="last_name" value="Einstein"&gt; &lt;/form&gt; </code></pre> <p><sup>original fields unchanged, get the data:<br> $_POST = array( 'first_name' => 'Albert' , 'last_name' => 'Einstein' )</sup></p> <hr> <pre><code>&lt;form method="POST" action="#"&gt; &lt;input type="text" name="first_name[]" value="Albert"&gt; &lt;input type="text" name="last_name[]" value="Einstein"&gt; &lt;/form&gt; </code></pre> <p><sup>adulterated fields, I get the data:<br> $_POST = array( 'first_name' => array( Albert ) , 'last_name' => array( Einstein ) )</sup></p> <hr> <pre><code>&lt;form method="POST" action="#"&gt; &lt;input type="text" name="first_name[]" value="Albert"&gt; &lt;input type="text" name="first_name[]" value="Einstein"&gt; &lt;/form&gt; </code></pre> <p><sup>adulterated fields, I get the data:<br> $_POST = array( 'first_name' => array( Albert , Einstein ) , 'last_name' => null )</sup></p> <hr> <ol> <li><p>I check if the field is of a type expected even before dealing with the 'class Validate'?<br> field_X if a string is as expected and I get an array , I mark it as a mistake or get the first element of the array?</p></li> <li><p>If I receive an array into a string field that must be how I'll fill out the form with the data sent ?<br> If I complete the field with <code>$_POST['XXX']</code> appears <code>Array</code></p></li> </ol> <p><br> I hope I have been clear since it is a real problem<br> Tanks to all</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload