From: Ori Livneh Date: Fri, 4 Oct 2013 00:50:45 +0000 (-0700) Subject: LESS embeddable(): Use lessc::toBool X-Git-Tag: 1.31.0-rc.0~18605^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=09b78734365543f5196eb13fc0b3ace00ca22d81;p=lhc%2Fweb%2Fwiklou.git 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 --- 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 ); } /**