Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When parsing a URL query string such as var1=value&var2=a=b where var2 should be equal to a=b the current code would create an array var2[0] = a and var2[1] = b. My proposal is to add a limit of 1, rather than 2 like in the dev branch, to the explode to ensure that any ='s in the value itself will be accepted.
Will submit patch when I have an issue number
Comment | File | Size | Author |
---|---|---|---|
#2 | link-limit-explode-to-one-2230157.patch | 470 bytes | brandonmoore |
Comments
Comment #1
brandonmoore CreditAttribution: brandonmoore commentedComment #2
brandonmoore CreditAttribution: brandonmoore commentedComment #3
brandonmoore CreditAttribution: brandonmoore commentedComment #4
brandonmoore CreditAttribution: brandonmoore commentedComment #5
jcfiala CreditAttribution: jcfiala commented'explode' doesn't work the way you seem to think it does.
explode("=", "this=that", 2)
produces an array where item 0 is "this" and item 1 is "that".explode("=", "this=that", 1)
produces an array with one item that contains "this=that". This is pretty clear from using drush:drush php-eval 'drush_print_r(explode("=", "this=that", 2));'
and
drush php-eval 'drush_print_r(explode("=", "this=that", 1));'
The code as it exists is what is needed.