summaryrefslogtreecommitdiffstats
path: root/system/application/models/file_mod.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xssn.at>2010-08-23 22:34:32 +0200
committerFlorian Pritz <bluewind@xssn.at>2010-08-23 22:34:32 +0200
commit596676c90ed3bb3dea6544a4ce00f47cbdd8c470 (patch)
tree126d44d0291d7e5210a784eaa0d3dee18380c054 /system/application/models/file_mod.php
parente2650e93529dae6f532e7bac4013c17a57bb70ad (diff)
add support for special filenames
Signed-off-by: Florian Pritz <bluewind@xssn.at>
Diffstat (limited to 'system/application/models/file_mod.php')
-rw-r--r--system/application/models/file_mod.php11
1 files changed, 11 insertions, 0 deletions
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: