diff --git a/codepot/src/codepot/views/code_file.php b/codepot/src/codepot/views/code_file.php index 1b5750e6..223d4ff7 100644 --- a/codepot/src/codepot/views/code_file.php +++ b/codepot/src/codepot/views/code_file.php @@ -14,15 +14,24 @@ { if ($pn == 'svn:mime-type') { - if ($pv == 'application/octet-stream' && - in_array (strtolower($fileext), array ('png', 'jpg', 'gif', 'tif', 'bmp', 'ico'))) + if ($pv == 'application/octet-stream') { - $img = @imagecreatefromstring ($file['content']); - if ($img !== FALSE) + $lower_fileext = strtolower($fileext); + if (in_array ($lower_fileext, array ('png', 'jpg', 'gif', 'tif', 'bmp', 'ico'))) + { + $img = @imagecreatefromstring ($file['content']); + if ($img !== FALSE) + { + @imagedestroy ($img); + $is_image_file = TRUE; + $is_special_stream = TRUE; + break; + } + } + else if (in_array ($lower_fileext, array ('pdf'))) { - @imagedestroy ($img); - $is_image_file = TRUE; $is_special_stream = TRUE; + $is_pdf_file = TRUE; break; } } @@ -502,7 +511,7 @@ if ($login['settings'] != NULL && print '