thom4parisot / wp-less

WordPress plugin which seemlessly compiles, caches and rebuilds your LESS stylesheets.
https://wordpress.org/plugins/wp-less/
88 stars 40 forks source link

$lessfile_in_theme error on Windows #131

Open davisctools opened 2 years ago

davisctools commented 2 years ago

When using this plugin on a server hosted in Windows, line 88 in lib/Stylesheet.class.php is not able to execute for two reasons:

  1. $this->stylesheet->src returns a url on my machine, which contains '/', but the search term is looking for DIRECTORY_SEPARATOR, which on my machine is \
  2. On a machine where DIRECTORY_SEPARATOR is \, preg_replace won't even be able to run, as the \ characters in the search term aren't escaped.

@pixelbart's pull request #124 largely fixes this issue, but still results in a warning appearing from the unescaped \

I believe this is the same error mentioned by Kari Sharp on the WordPress support forums.