From eca7e254f2938b943425a7034e14eadc241c3bc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Ra=C3=B1a?= Date: Sat, 14 Jul 2012 11:00:34 +0200 Subject: [PATCH] download documents only filter thumbs when there are thumbs in url --- main/document/download.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main/document/download.php b/main/document/download.php index 99029cd1f6..9e97e51e8e 100644 --- a/main/document/download.php +++ b/main/document/download.php @@ -83,8 +83,10 @@ if (Security::check_abs_path($sys_course_path.$doc_url, $sys_course_path.'/')) { //Documents' slideshow thumbnails //correct $is_visible used in below and ??. Now the students can view the thumbnails too - $doc_url_thumbs = str_replace('.thumbs/.', '', $doc_url); - $is_visible = DocumentManager::is_visible($doc_url_thumbs, $_course, api_get_session_id()); + if ( preg_match('/\.thumbs\/\./', $doc_url)){ + $doc_url_thumbs = str_replace('.thumbs/.', '', $doc_url); + $is_visible = DocumentManager::is_visible($doc_url_thumbs, $_course, api_get_session_id()); + } if (!api_is_allowed_to_edit() && !$is_visible) { Display::display_error_message(get_lang('ProtectedDocument'));//api_not_allowed backbutton won't work.