From 00f3501605ab2dd1362b6046648d218b20671b98 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Wed, 15 May 2019 13:19:58 +0200 Subject: Pygments: Skip lexers that do not have names With pygments 2.4.0 at least VBScript doesn't have a name and thus causes an exception when the first name should be used. We use the name to tell pygmentize which lexer to use so listing a lexer that doesn't have a name doesn't work and thus there is no point in showing it in the list. Signed-off-by: Florian Pritz --- application/libraries/Pygments.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'application') diff --git a/application/libraries/Pygments.php b/application/libraries/Pygments.php index c8e1f8028..074e8a6c1 100644 --- a/application/libraries/Pygments.php +++ b/application/libraries/Pygments.php @@ -38,6 +38,9 @@ class Pygments { $last_desc = ""; foreach (self::get_pygments_info() as $lexer) { + if (empty($lexer['names'])) { + continue; + } $desc = $lexer['fullname']; $name = $lexer['names'][0]; if ($desc == $last_desc) { -- cgit v1.2.3-24-g4f1b