From ec8851e46c0d395c263ae5dcb55acc17968f9b85 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Thu, 17 Sep 2015 20:47:00 +0200 Subject: [PATCH] support < 0.21 syntax highlighting --- lib/zerobin.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/zerobin.php b/lib/zerobin.php index 8e2331ce..595ba22a 100644 --- a/lib/zerobin.php +++ b/lib/zerobin.php @@ -589,7 +589,15 @@ class zerobin // set formatter for for the view. if (!property_exists($paste->meta, 'formatter')) { - $paste->meta->formatter = $this->_getMainConfig('defaultformatter', 'syntaxhighlighting'); + // support < 0.21 syntax highlighting + if (property_exists($paste->meta, 'syntaxcoloring') && $paste->meta->syntaxcoloring === true) + { + $paste->meta->formatter = 'syntaxhighlighting'; + } + else + { + $paste->meta->formatter = $this->_getMainConfig('defaultformatter', 'syntaxhighlighting'); + } } $this->_data = json_encode($messages);