[wp-trac] [WordPress Trac] #45387: Valid HTML get mangled on the frontend

WordPress Trac noreply at wordpress.org
Thu Mar 30 14:21:56 UTC 2023


#45387: Valid HTML get mangled on the frontend
--------------------------+------------------------------
 Reporter:  youknowriad   |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Editor        |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by ninetyninew):

 We have recently been made aware of an issue which sounds like this one
 found by use of the twentytwentythree theme.

 An example is if, for example, you are using the twentytwentythree theme
 with WooCommerce, if you add some custom inline HTML and JS code via the
 `woocommerce_after_add_to_cart_quantity` hook.

 We added a select field with some options, the values of these options are
 URLs and when selected it redirects the user to the URL in the value,
 these URLs are concatenated strings based on some PHP conditions and add
 query args like '&something=1' to the string which is then added to the
 empty value of the select fields, the build of the URL and the
 functionality which does the redirect upon selection are in an inline
 `<script>` tag, the resulting URLs don't remain `&something=1` and get
 converted to `#038;something=1`, this then means we cannot use the
 `$_GET['something']`.

 If we switch from twentytwentythree to a classic theme, the conversion of
 `&` to `#038;` doesn't occur.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/45387#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list