From a11e06d4906c2e1186779b42d5e87a17f66c50ea Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Thu, 9 Apr 2015 15:17:13 +0200 Subject: Fix mime2lexer failing when using pygments info Signed-off-by: Florian Pritz --- application/libraries/Pygments.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'application/libraries') diff --git a/application/libraries/Pygments.php b/application/libraries/Pygments.php index 13d82d2ad..04d4e670c 100644 --- a/application/libraries/Pygments.php +++ b/application/libraries/Pygments.php @@ -21,7 +21,7 @@ class Pygments { } private static function get_pygments_info() { - return cache_function_full('pygments_info', 1800, function() { + return cache_function_full('pygments_info-v2', 1800, function() { ob_start(); passthru("python ".escapeshellarg(FCPATH."scripts/get_lexer_list.py")); $output = ob_get_clean(); @@ -148,7 +148,7 @@ class Pygments { // fall back to pygments own list if not found in our list foreach (self::get_pygments_info() as $lexer) { if (isset($lexer['mimetypes'][$this->mimetype])) { - return $lexer; + return $lexer['names'][0]; } } -- cgit v1.2.3-24-g4f1b