Closed pixelchutes closed 3 years ago
Given the following example <select>, I am noticing unexpected behavior on the empty option value:
<select>
<select name="h:my_hidden_field" id="my_hidden_field" class="form-control"> <option value="" data-index="0">Example (empty)</option> <option value="A" data-index="1">Example 1</option> <option value="B" data-index="2">Example 2</option> <option value="C" data-index="3">Example 3</option> </select>
<select name="h:my_hidden_field" id="my_hidden_field" class="form-control"> <option value="" data-index=||HMAC_HASH_HERE"0">Example (empty)</option> <option value="A||HMAC_HASH_HERE" data-index="1">Example 1</option> <option value="B||HMAC_HASH_HERE" data-index="2">Example 2</option> <option value="C||HMAC_HASH_HERE" data-index="3">Example 3</option> </select>
Notice the placement of the hmac hash on the "empty" example.
Further, since this is for a hidden custom field, shouldn't the signing be skipping hidden fields altogether?
I made a PR to fix the signing of empty option values: https://github.com/FoxyCart/FoxyCart-Cart-Validation--PHP/pull/17
Given the following example
<select>
, I am noticing unexpected behavior on the empty option value:BEFORE SIGNING
AFTER SIGNING
Notice the placement of the hmac hash on the "empty" example.
Further, since this is for a hidden custom field, shouldn't the signing be skipping hidden fields altogether?