xwp / wp-dependency-minification

Dependency Minification plugin for WordPress
http://wordpress.org/plugins/dependency-minification/
52 stars 10 forks source link

`DIRECTORY_SEPARATOR` breaks resource URL path #75

Open brainfork opened 2 years ago

brainfork commented 2 years ago

Use of the DIRECTORY_SEPARATOR constant here: https://github.com/xwp/wp-dependency-minification/blob/c579d699e9ba9facdeee721675e51930c0c6f839/dependency-minification.php#L508 is causing the path to a minified resource to be returned as https://HOME_URL\_minify/RESOURCE_PATH. It's also not necessary as per the discussion here: https://stackoverflow.com/questions/26881333/when-to-use-directory-separator-in-php-code/26881417#comment90090608_26881417

I recommend updating the line to: $src = trailingslashit( get_option( 'home' ) . '/' . self::$options['endpoint'] ); or $src = trailingslashit( trailingslashit( get_option( 'home' ) ) . self::$options['endpoint'] );