From 0702e8b7b343d3b1ea421875f5d62e40d2c07d69 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Thu, 2 Apr 2015 17:24:36 +0200 Subject: Fix automatic highlight of svg files They should not be highlit.. Signed-off-by: Florian Pritz --- application/libraries/Pygments.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'application') diff --git a/application/libraries/Pygments.php b/application/libraries/Pygments.php index be59beb90..24975d6a1 100644 --- a/application/libraries/Pygments.php +++ b/application/libraries/Pygments.php @@ -48,21 +48,21 @@ class Pygments { }); } + // Allow certain types to be highlight without doing it automatically public function should_highlight() { + $typearray = array( + 'image/svg+xml', + ); + if (in_array($this->mimetype, $typearray)) return false; + if ($this->mime2lexer($this->mimetype)) return true; return false; } - // Allow certain types to be highlight without doing it automatically public function can_highlight() { - $typearray = array( - 'image/svg+xml', - ); - if (in_array($this->mimetype, $typearray)) return true; - if ($this->mime2lexer($this->mimetype)) return true; return false; @@ -71,7 +71,7 @@ class Pygments { // Return the lexer that should be used for highlighting public function autodetect_lexer() { - if (!$this->can_highlight($this->mimetype)) { + if (!$this->should_highlight()) { return false; } -- cgit v1.2.3-24-g4f1b