From 09b78734365543f5196eb13fc0b3ace00ca22d81 Mon Sep 17 00:00:00 2001 From: Ori Livneh Date: Thu, 3 Oct 2013 17:50:45 -0700 Subject: [PATCH] LESS embeddable(): Use lessc::toBool With Ib6bc76736 in place, we have access to lessphp's custom function helpers, which provide some nice encapsulation for interpreter internals like boolean nodes. This patch makes embeddable() call $less->toBool() rather than construct its own AST nodes. Change-Id: I0a015564dff19f5ced764af182558eb351e3d816 --- includes/resourceloader/ResourceLoaderLESSFunctions.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/includes/resourceloader/ResourceLoaderLESSFunctions.php b/includes/resourceloader/ResourceLoaderLESSFunctions.php index 08d574c87e..c7570f6435 100644 --- a/includes/resourceloader/ResourceLoaderLESSFunctions.php +++ b/includes/resourceloader/ResourceLoaderLESSFunctions.php @@ -39,11 +39,10 @@ class ResourceLoaderLESSFunctions { $base = pathinfo( $less->parser->sourceName, PATHINFO_DIRNAME ); $url = $frame[2][0]; $file = realpath( $base . '/' . $url ); - $embeddable = ( $file + return $less->toBool( $file && strpos( $url, '//' ) === false && filesize( $file ) < CSSMin::EMBED_SIZE_LIMIT - && CSSMin::getMimeType( $file ) !== false ) ? 'true' : 'false'; - return array( 'keyword', $embeddable ); + && CSSMin::getMimeType( $file ) !== false ); } /** -- 2.20.1