From be8f8ad78902d3c2e85f4dda55a9e614edd0669c Mon Sep 17 00:00:00 2001 From: amontero Date: Fri, 18 Jan 2013 14:00:56 +0100 Subject: [PATCH 1/2] Add .inc file extension as PHP type. --- code.php | 4 ++-- code/filemanipulation.php | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/code.php b/code.php index 3cefb54..ae1b4ba 100644 --- a/code.php +++ b/code.php @@ -31,7 +31,7 @@ } } -$cnf['uploadWhitelist'] = array( "php", "js", "html", "css", "txt", "htaccess", "ini" ); +$cnf['uploadWhitelist'] = array( 'php', 'inc', 'js', 'html', 'css', 'txt', 'htaccess', 'ini' ); $cnf['showHidden']=false; //Show hidden files in tree? include "code/base/io.php"; @@ -39,4 +39,4 @@ include "code/tree.php"; include "code/env.php"; -$i=Input::_get(); \ No newline at end of file +$i=Input::_get(); diff --git a/code/filemanipulation.php b/code/filemanipulation.php index 3abf82c..f511f60 100644 --- a/code/filemanipulation.php +++ b/code/filemanipulation.php @@ -227,7 +227,18 @@ public static function getFileEditingInfo($file) { $sfi=new SplFileInfo($file); $content=trim(htmlspecialchars(file_get_contents($sfi->getRealPath()))); $ext=$sfi->getExtension(); - $mimes=array("php"=>"application/x-httpd-php-open","js"=>"text/javascript","html"=>"text/html","css"=>"text/css","text"=>"text/plain","cpp"=>"text/x-c++src", "c"=>"text/x-csrc","py"=>"text/x-python","pl"=>"text/x-perl"); + $mimes=array( + 'php'=>'application/x-httpd-php-open', + 'inc'=>'application/x-httpd-php-open', + 'js'=>'text/javascript', + 'html'=>'text/html', + 'css'=>'text/css', + 'text'=>'text/plain', + 'cpp'=>'text/x-c++src', + 'c'=>'text/x-csrc', + 'py'=>'text/x-python', + 'pl'=>'text/x-perl', + ); $cmMime=$mimes[$ext]; Output::add("content",$content); Output::add("cmMime",$cmMime); @@ -265,4 +276,4 @@ public static function editSave($file,$newcontent) { return; } } -} \ No newline at end of file +} From 85668cf239a48b1b545d0ff35956288c02f9c807 Mon Sep 17 00:00:00 2001 From: amontero Date: Fri, 18 Jan 2013 19:19:51 +0100 Subject: [PATCH 2/2] Add link to configuration help. --- code.php | 1 + 1 file changed, 1 insertion(+) diff --git a/code.php b/code.php index ae1b4ba..c83cc62 100644 --- a/code.php +++ b/code.php @@ -2,6 +2,7 @@ include "code/base/server.php"; // MOST IMPORTANT SETTING -- path to editable files ## +// Read more at http://ecoder.quintalinda.com/docs/installation.html $code['root'] = 'D:/dev/ecoder/testingdata/'; // full path, with trailing slash ## if (!$live) { // running locally ## $code['root'] = 'D:/dev/ecoder/testingdata/'; // local path -- for testing ##