Ori.livneh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/87493


Change subject: LESS embeddable(): Use lessc::toBool
......................................................................

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
---
M includes/resourceloader/ResourceLoaderLESSFunctions.php
1 file changed, 2 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/93/87493/1

diff --git a/includes/resourceloader/ResourceLoaderLESSFunctions.php 
b/includes/resourceloader/ResourceLoaderLESSFunctions.php
index 08d574c..c7570f6 100644
--- a/includes/resourceloader/ResourceLoaderLESSFunctions.php
+++ b/includes/resourceloader/ResourceLoaderLESSFunctions.php
@@ -39,11 +39,10 @@
                $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 );
        }
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/87493
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0a015564dff19f5ced764af182558eb351e3d816
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <o...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to