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

Invalid handling for SELECT menu options #1

Closed
pixelchutes opened this issue Aug 16, 2010 · 1 comment
Closed

Invalid handling for SELECT menu options #1

pixelchutes opened this issue Aug 16, 2010 · 1 comment

Comments

@pixelchutes
Copy link

I am seeing some incomplete behavior with regards to <select> <option> hashing:

<select name="quantity">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>

is becoming:

<select name="quantity">
<option value=||c49e975314be4d896d4f32bf6f087583834fb6032d4a31ad060ab18d1ad8167a">1</option>
<option value=||d4a8aa60da2bbdf94e0af8473cd0a593ac1463cf75a41aa990bcce59ab628389">2
<option value=||0051cdc38ae629b31ece002de6ea7c199588d88f59325a263684a06afe10667e">3</option>
</select>

The conversion is not occurring correctly for my Quantity drop down, since <option value="1">1</option> is becoming <option value=||c49e975314be4d896d4f32bf6f087583834fb6032d4a31ad060ab18d1ad8167a">1</option>

(NOTE: missing starting quotation marks + source value)

I was able to get this working as expected by changing Line 243 to the following:

#$option_signed = preg_replace('%([\'"])'.preg_quote($option[2]).'\1%', "$1".self::fc_hash_value($code, $list[2], $option[2], 'value', FALSE)."$1", $option[0]);
$option_signed = preg_replace('%('.preg_quote($option[1]).')'.preg_quote($option[2]).preg_quote($option[1]).'%', $option[1].self::fc_hash_value($code, $list[2], $option[2], 'value', FALSE).$option[1], $option[0]);

...it seemed the "$1" on "$1".self::fc_hash was somehow related to the behavior I was seeing, but should be perfectly valid to reference $option[1] created from the first preg_match_all call.

@brettflorio
Copy link
Contributor

Nice catch. Fixed in badbdcb.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants