summaryrefslogtreecommitdiffstats
path: root/system/application
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xssn.at>2010-11-23 15:58:11 +0100
committerFlorian Pritz <bluewind@xssn.at>2010-11-23 15:58:11 +0100
commit6f16b564d0d774de979b18bf89c2358d0f8bc487 (patch)
tree3c3837a255ed1002d605eb841454325215834e7b /system/application
parent379d0c29bcaa5755f73eabe2c55081e8ebecafae (diff)
add aliases for highlight extensions
Signed-off-by: Florian Pritz <bluewind@xssn.at>
Diffstat (limited to 'system/application')
-rw-r--r--system/application/models/file_mod.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/system/application/models/file_mod.php b/system/application/models/file_mod.php
index 20ebe58f4..24b491831 100644
--- a/system/application/models/file_mod.php
+++ b/system/application/models/file_mod.php
@@ -182,6 +182,7 @@ class File_mod extends Model {
$mode = $this->mime2extension($type);
$mode = $this->filename2extension($filedata['filename']) ? $this->filename2extension($filedata['filename']) : $mode;
}
+ $mode = $this->extension_aliases($mode);
// TODO: cleanup conditions
if ($mode && $mode != 'plain' && $mode != 'qr'
@@ -375,6 +376,17 @@ class File_mod extends Model {
return false;
}
+ // Handle alias extensions
+ function extension_aliases($alias)
+ {
+ $aliasarray = array(
+ 'py' => 'python'
+ );
+ if (array_key_exists($alias, $aliasarray)) return $aliasarray[$alias];
+
+ return $alias;
+ }
+
}
# vim: set noet: