From c037d09840f32b02aec40f2b34d2647692182e24 Mon Sep 17 00:00:00 2001 From: Peter Molnar Date: Wed, 10 Aug 2016 09:21:23 +0000 Subject: [PATCH] preg replace is better --- .gitignore | 1 - wp-autoless.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 3a9875b..2659611 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -/vendor/ composer.lock diff --git a/wp-autoless.php b/wp-autoless.php index a2b09d8..6ca2b2a 100644 --- a/wp-autoless.php +++ b/wp-autoless.php @@ -37,7 +37,7 @@ function compile () { foreach ( $lessfiles as $lessfile ) { $lessmtime = filemtime( $lessfile ); - $cssfile = str_replace( '.less', '.css', $lessfile ); + $cssfile = preg_replace( '/\.less$/i', '.css', $lessfile ); $cssmtime = file_exists ( $cssfile ) ? filemtime( $cssfile ) : '0'; if ( $cssmtime < $lessmtime ) {