From 596676c90ed3bb3dea6544a4ce00f47cbdd8c470 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 23 Aug 2010 22:34:32 +0200 Subject: add support for special filenames Signed-off-by: Florian Pritz --- system/application/models/file_mod.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'system/application') diff --git a/system/application/models/file_mod.php b/system/application/models/file_mod.php index 9e9a8b4da..fd49c30c0 100644 --- a/system/application/models/file_mod.php +++ b/system/application/models/file_mod.php @@ -160,6 +160,7 @@ class File_mod extends Model { if (!$mode && substr_count(ltrim($this->uri->uri_string(), "/"), '/') >= 1) { $mode = $this->mime2extension($type); + $mode = $this->filename2extension($filedata['filename']) ? $this->filename2extension($filedata['filename']) : $mode; } if (!$modified) { @@ -349,6 +350,16 @@ class File_mod extends Model { return false; } + function filename2extension($name) + { + $namearray = array( + 'PKGBUILD' => 'sh' + ); + if (array_key_exists($name, $namearray)) return $namearray[$name]; + + return false; + } + } # vim: set ts=2 sw=2 et: -- cgit v1.2.3-24-g4f1b