Procházet zdrojové kódy

support < 0.21 syntax highlighting

El RIDO před 11 roky
rodič
revize
ec8851e46c
1 změnil soubory, kde provedl 9 přidání a 1 odebrání
  1. 9 1
      lib/zerobin.php

+ 9 - 1
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);