diff --git a/codepot/src/codepot/views/code_file.php b/codepot/src/codepot/views/code_file.php index 90cbea21..5590687c 100644 --- a/codepot/src/codepot/views/code_file.php +++ b/codepot/src/codepot/views/code_file.php @@ -230,7 +230,42 @@ if ($login['settings'] != NULL && ?>
-
+ 0)
+ {
+ foreach ($file['properties'] as $pn => $pv)
+ {
+ if ($pn == 'svn:mime-type' && $pv == 'application/octet-stream')
+ {
+ $is_octet_stream = 1;
+ 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)
+ {
+ $img = @imagecreatefromstring ($file['content']);
+ if ($img !== FALSE)
+ {
+ @imagedestroy ($img);
+ print ('
');
+ $is_image_stream = TRUE;
+ }
+ }
+
+ if (!$is_image_stream) print htmlspecialchars($file['content']);
+?>