diff --git a/main/document/document.inc.php b/main/document/document.inc.php index 5e4c3bc0ff..4d9b7549b8 100755 --- a/main/document/document.inc.php +++ b/main/document/document.inc.php @@ -237,15 +237,15 @@ function create_document_link($document_data, $show_as_icon = false, $counter = //target="'.$target.'" if ($filetype == 'file') { //Sound preview with jplayer - if ( preg_match('/mp3$/', urldecode($url)) || - preg_match('/wav$/', urldecode($url)) || - preg_match('/ogg$/', urldecode($url))) { + if ( preg_match('/mp3$/i', urldecode($url)) || + preg_match('/wav$/i', urldecode($url)) || + preg_match('/ogg$/i', urldecode($url))) { return ''.$title.''.$force_download_html.$copy_to_myfiles.$open_in_new_window_link.$pdf_icon; } elseif ( //Show preview sith yoxview - preg_match('/swf$/', urldecode($url)) || - preg_match('/html$/', urldecode($url)) || - preg_match('/htm$/', urldecode($url)) //|| (preg_match('/wav$/', urldecode($url)) && api_get_setting('enable_nanogong') == 'true') + preg_match('/swf$/i', urldecode($url)) || + preg_match('/html$/i', urldecode($url)) || + preg_match('/htm$/i', urldecode($url)) //|| (preg_match('/wav$/', urldecode($url)) && api_get_setting('enable_nanogong') == 'true') ) { $url = 'showinframesmin.php?'.api_get_cidreq().'&id='.$document_data['id'].$req_gid; return ''.$title.''.$force_download_html.$copy_to_myfiles.$open_in_new_window_link.$pdf_icon; @@ -258,21 +258,20 @@ function create_document_link($document_data, $show_as_icon = false, $counter = } //end copy files to users myfiles } else { - //Icon column if (preg_match('/shared_folder/', urldecode($url)) && preg_match('/shared_folder$/', urldecode($url))==false && preg_match('/shared_folder_session_'.$current_session_id.'$/', urldecode($url))==false){ if ($filetype == 'file') { //Sound preview with jplayer - if ( preg_match('/mp3$/', urldecode($url)) || - preg_match('/wav$/', urldecode($url)) || - preg_match('/ogg$/', urldecode($url))) { + if ( preg_match('/mp3$/i', urldecode($url)) || + preg_match('/wav$/i', urldecode($url)) || + preg_match('/ogg$/i', urldecode($url))) { $sound_preview = DocumentManager::generate_mp3_preview($counter); return $sound_preview ; } elseif ( //Show preview sith yoxview - preg_match('/swf$/', urldecode($url)) || - preg_match('/html$/', urldecode($url)) || - preg_match('/htm$/', urldecode($url)) //|| (preg_match('/wav$/', urldecode($url)) && api_get_setting('enable_nanogong') == 'true') + preg_match('/swf$/i', urldecode($url)) || + preg_match('/html$/i', urldecode($url)) || + preg_match('/htm$/i', urldecode($url)) //|| (preg_match('/wav$/', urldecode($url)) && api_get_setting('enable_nanogong') == 'true') ) { $url = 'showinframesmin.php?'.api_get_cidreq().'&id='.$document_data['id'].$req_gid; return ''.build_document_icon_tag($filetype, $path).Display::return_icon('shared.png', get_lang('ResourceShared'), array('hspace' => '5', 'align' => 'middle', 'height' => 22, 'width' => 22)).''; @@ -285,16 +284,16 @@ function create_document_link($document_data, $show_as_icon = false, $counter = } else { if ($filetype == 'file') { //Sound preview with jplayer - if ( preg_match('/mp3$/', urldecode($url)) || - preg_match('/wav$/', urldecode($url)) || - preg_match('/ogg$/', urldecode($url))) { + if ( preg_match('/mp3$/i', urldecode($url)) || + preg_match('/wav$/i', urldecode($url)) || + preg_match('/ogg$/i', urldecode($url))) { $sound_preview = DocumentManager::generate_mp3_preview($counter); return $sound_preview ; } elseif ( //Show preview sith yoxview - preg_match('/swf$/', urldecode($url)) || - preg_match('/html$/', urldecode($url)) || - preg_match('/htm$/', urldecode($url)) //|| (preg_match('/wav$/', urldecode($url)) && api_get_setting('enable_nanogong') == 'true') + preg_match('/swf$/i', urldecode($url)) || + preg_match('/html$/i', urldecode($url)) || + preg_match('/htm$/i', urldecode($url)) //|| (preg_match('/wav$/', urldecode($url)) && api_get_setting('enable_nanogong') == 'true') ) { $url = 'showinframesmin.php?'.api_get_cidreq().'&id='.$document_data['id'].$req_gid; return ''.build_document_icon_tag($filetype, $path).''; diff --git a/main/document/document.php b/main/document/document.php index f06ee1d5d1..2d76d8a5b6 100755 --- a/main/document/document.php +++ b/main/document/document.php @@ -888,9 +888,6 @@ $table_footer = ''; $total_size = 0; if (isset($docs_and_folders) && is_array($docs_and_folders)) { - //echo('
'); - //print_r($docs_and_folders); - //echo(''); // Do we need the title field for the document name or not? // We get the setting here, so we only have to do it once @@ -957,7 +954,7 @@ if (isset($docs_and_folders) && is_array($docs_and_folders)) { $row[] = create_document_link($document_data, true, $count); $path_info = pathinfo($document_data['path']); - if (isset($path_info['extension']) && in_array($path_info['extension'], array('ogg', 'mp3','wav'))) { + if (isset($path_info['extension']) && in_array(strtolower($path_info['extension']), array('ogg', 'mp3','wav'))) { $count ++; }