From cc88235d78df053119ca16b4c90ac440df5f2e10 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Sun, 1 May 2016 15:40:07 -0500 Subject: [PATCH] Issue 153: SQL preview support --- indefero/src/IDF/FileUtil.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/indefero/src/IDF/FileUtil.php b/indefero/src/IDF/FileUtil.php index 63f0163..7f06471 100644 --- a/indefero/src/IDF/FileUtil.php +++ b/indefero/src/IDF/FileUtil.php @@ -36,7 +36,7 @@ class IDF_FileUtil 'h', 'hh', 'hpp', 'hs', 'html', 'html', 'java', 'js', 'lisp', 'master', 'pas', 'perl', 'php', 'pl', 'pm', 'py', 'rb', 'scm', 'sh', 'sitemap', 'skin', 'sln', 'svc', 'vala', 'vb', 'vbproj', 'vbs', 'wsdl', 'xhtml', - 'xml', 'xsd', 'xsl', 'xslt'); + 'xml', 'xsd', 'xsl', 'xslt', 'sql'); public static $imageExtensions = ["png", "gif", "jpeg", "jpg"]; @@ -84,17 +84,18 @@ class IDF_FileUtil return Pluf_Template::markSafe(implode("\n", $table));*/ //var_dump($fileinfo); $ext = ""; - if (in_array($fileinfo[2], self::$syntaxhighlightext)) + if (in_array($fileinfo[2], self::$syntaxhighlightext)) { $ext = $fileinfo[2]; - elseif (array_key_exists($fileinfo[2], self::$map)) + } elseif (array_key_exists($fileinfo[2], self::$map)) { $ext = self::$map[$fileinfo[2]]; - else + } else { $ext = "text"; - if ($ext == "php" || $ext == "html" || $ext == "htm" || $ext == "js") + } + if ($ext == "php" || $ext == "html" || $ext == "htm" || $ext == "js") { $content = '
' . str_replace("<", "<", $content) . '
'; - else + } else { $content = '
'; - + } } if (self::isImage($fileinfo)) {