Might have resolved incorrect open types.

This commit is contained in:
Maxim Stewart 2018-04-18 06:25:33 -05:00
parent 79e3bdf7f6
commit a7eebb7d78
1 changed files with 7 additions and 6 deletions

View File

@ -2,19 +2,20 @@
function openFile($FILE) {
include 'config.php';
$EXTNSN = strtolower(pathinfo($FILE, PATHINFO_EXTENSION));
if (preg_match('(.mkv|.avi|.flv|.mov|.m4v|.mpg|.wmv|.mpeg)', strtolower($FILE)) === 1) {
if (preg_match('(mkv|avi|flv|mov|m4v|mpg|wmv|mpeg)', $EXTNSN) === 1) {
shell_exec($MEDIAPLAYER . " \"" . $FILE . "\" &");
} else if (preg_match('(.png|.jpg|.jpeg|.gif)', strtolower($FILE)) === 1) {
} else if (preg_match('(png|jpg|jpeg|gif)', $EXTNSN) === 1) {
shell_exec($IMGVIEWER . ' "' . $FILE . '" &');
} else if (preg_match('(.psf|.mp3|.ogg|.flac)', strtolower($FILE)) === 1) {
} else if (preg_match('(psf|mp3|ogg|flac)', $EXTNSN) === 1) {
shell_exec($MUSICPLAYER . ' "' . $FILE . '" &');
} else if (preg_match('(.txt)', strtolower($FILE)) === 1) {
} else if (preg_match('(txt)', $EXTNSN) === 1) {
shell_exec($TEXTVIEWER . ' "' . $FILE . '" &');
} else if (preg_match('(.pdf)', strtolower($FILE)) === 1) {
} else if (preg_match('(pdf)', $EXTNSN) === 1) {
shell_exec($PDFVIEWER . ' "' . $FILE . '" &');
// Has to be below b/c pdf somehow regesters and an office app.... wtf....
} else if (preg_match('(.odt|.doc|.docx|.rtf)', strtolower($FILE)) === 1) {
} else if (preg_match('(odt|doc|docx|rtf)', $EXTNSN) === 1) {
shell_exec($OFFICEPROG . ' "' . $FILE . '" &');
}
}