wearerequired / h2push

Sends Link headers to bring HTTP/2 Server Push for scripts and styles to WordPress.
GNU General Public License v2.0
5 stars 0 forks source link

Only add 'ver' query arg if script/style ver property === false #2

Closed dotsam closed 6 years ago

dotsam commented 6 years ago

First off, thanks for the plugin. Does exactly what I want in a nice lightweight manner.

I have found a bug however in how the plugin is appending 'ver' query args to URLs. As per the WordPress docs (https://developer.wordpress.org/reference/functions/wp_enqueue_style/), the WordPress version is only added if $ver is set to false (also the default). If $ver is set to null instead, no version string is added.

Your check for !empty() catches both cases the same. There needs to be another outcome where no query argument is added when $ver === null.

ocean90 commented 6 years ago

Hi @dotsam, sorry for late response!

Thanks for the hint, wasn't aware of the null feature. I'll update the plugin to not add the version in this case.