summaryrefslogtreecommitdiff
path: root/includes/inc_files.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/inc_files.php')
-rwxr-xr-xincludes/inc_files.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/includes/inc_files.php b/includes/inc_files.php
index 0a48aeb..266059d 100755
--- a/includes/inc_files.php
+++ b/includes/inc_files.php
@@ -1,6 +1,6 @@
<?php
-$audiotypes='mp3 aac wav';
+$audiotypes='mp3 aac wav ';
function mediagetinfostream($stream = "")
{
@@ -48,15 +48,15 @@ function mediagetinfostream($stream = "")
function mediagettype($file)
{
global $videotypes, $audiotypes;
-
+
// Get file extension
$fileext = end(explode(".", $file));
if (is_dir($file))
return 3;
- if ( preg_match("/" .$fileext ." /", $videotypes) || preg_match("/" .$fileext ." $/", $videotypes) )
+ if (preg_match("/" .$fileext ." /", $videotypes))
return 1;
- else if ( preg_match("/" .$fileext ." /", $audiotypes) || preg_match("/" .$fileext ." $/", $audiotypes) )
+ else if (preg_match("/" .$fileext ." /", $audiotypes))
return 2;
else
return 0;
@@ -67,8 +67,12 @@ function mediadirhasaudio($dir)
global $audiotypes;
$audioextarray = explode(' ', $audiotypes);
+
foreach ($audioextarray as $num => $audioext)
+ {
if (glob($dir .'*.' .$audioext))
return 1;
+ }
+
return 0;
}