preg replace is better

This commit is contained in:
Peter Molnar 2016-08-10 09:21:23 +00:00
parent 90b7e3d3bc
commit c037d09840
2 changed files with 1 additions and 2 deletions

1
.gitignore vendored
View file

@ -1,2 +1 @@
/vendor/
composer.lock composer.lock

View file

@ -37,7 +37,7 @@ function compile () {
foreach ( $lessfiles as $lessfile ) { foreach ( $lessfiles as $lessfile ) {
$lessmtime = filemtime( $lessfile ); $lessmtime = filemtime( $lessfile );
$cssfile = str_replace( '.less', '.css', $lessfile ); $cssfile = preg_replace( '/\.less$/i', '.css', $lessfile );
$cssmtime = file_exists ( $cssfile ) ? filemtime( $cssfile ) : '0'; $cssmtime = file_exists ( $cssfile ) ? filemtime( $cssfile ) : '0';
if ( $cssmtime < $lessmtime ) { if ( $cssmtime < $lessmtime ) {