From 05d7176321116d11e211806ab0153aeb39f2aea3 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Fri, 13 Feb 2015 07:28:11 +0000 Subject: [PATCH] changed the way to detect images in the code-file view --- codepot/src/codepot/views/code_file.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/codepot/src/codepot/views/code_file.php b/codepot/src/codepot/views/code_file.php index 5590687c..78557fdf 100644 --- a/codepot/src/codepot/views/code_file.php +++ b/codepot/src/codepot/views/code_file.php @@ -231,29 +231,22 @@ if ($login['settings'] != NULL &&
  0)
 	{
 		foreach ($file['properties'] as $pn => $pv)
 		{
 			if ($pn == 'svn:mime-type' && $pv == 'application/octet-stream')
 			{
-				$is_octet_stream = 1;
+				$is_octet_stream = TRUE;
 				break;
 			}
-			else if ($pn == 'svn:executable' && $pv == '*')
-			{
-				if (in_array (strtolower($fileext), array ('png', 'jpg', 'gif', 'tif', 'bmp', 'ico')))
-				{
-					$is_octet_stream = -1; /* not sure */
-					break;
-				}
-			}
 		}
 	}
 
 	$is_image_stream = FALSE;
-	if ($is_octet_stream != 0)
+	if ($is_octet_stream || 
+	    in_array (strtolower($fileext), array ('png', 'jpg', 'gif', 'tif', 'bmp', 'ico')))
 	{
 		$img = @imagecreatefromstring ($file['content']);		
 		if ($img !== FALSE)