[wp-trac] [WordPress Trac] #26886: wp_enqueue_script doesn't load all scripts

WordPress Trac noreply at wordpress.org
Wed Feb 15 17:07:46 UTC 2017


#26886: wp_enqueue_script doesn't load all scripts
-------------------------------+------------------------------
 Reporter:  alfredocubitos     |       Owner:
     Type:  defect (bug)       |      Status:  reopened
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Script Loader      |     Version:  3.8
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by emanueleivaldi):

 Hi all,

 I don't think it's a good idea to arbitrary split the $concat without
 worrying about its actual content.

 This can cause unexpected issues because it '''inherently''' relies on the
 fact that the order of the query parameters will be maintained.

 When this doesn't happen (e.g. the reverse proxy in front of your
 application reorders the query parameters) wordpress won't be able to
 reconstruct the original query parameter

 Imagine you have the string "this,is,just,an,example"

 if you arbitrary split after n characters (10 for this example) you will
 end up with

 ?load[]=this,is,ju&load[]=st,an,exam&load[]=ple

 if you keep the order of the query parameters you can reconstruct the
 original string but if you don't you can end up having something like
 this:

 ?load[]=stan,exam&load[]=ple&load[]=this,is,ju

 from these query params you only reconstruct a few words

 '''"this"''', '''"example"''' and '''"is"'''  and you are going to lose
 '''"just"''' and '''"an"'''.

 If the would pay attention to the actual content and avoids truncating
 words this problem will disappear.

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


More information about the wp-trac mailing list