[interchange-cvs] [SCM] Interchange branch, master, updated. REL_5_7_3-26-g716009e

Stefan Hornburg interchange-cvs at icdevgroup.org
Fri Nov 27 10:56:07 UTC 2009


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Interchange".

The branch, master has been updated
       via  716009e84ea723202559458e5cd9db39b350f56b (commit)
      from  10929c6cb0ba3eb7a5ac9da927692b9280651cd2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 716009e84ea723202559458e5cd9db39b350f56b
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Fri Nov 27 11:55:09 2009 +0100

    check first whether file exists before determing file type
    avoid encoding of binary files

-----------------------------------------------------------------------

Summary of changes and diff:
 code/SystemTag/deliver.coretag |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/code/SystemTag/deliver.coretag b/code/SystemTag/deliver.coretag
index 08b4955..6f8f006 100644
--- a/code/SystemTag/deliver.coretag
+++ b/code/SystemTag/deliver.coretag
@@ -18,9 +18,19 @@ sub {
 	use vars qw/$Tag/;
 	$Tag ||= new Vend::Tags;
 	if($opt->{file}) {
-		$type ||= Vend::Util::mime_type($opt->{file});
 		return undef unless -f $opt->{file};
-		my $tmp = readfile($opt->{file});
+
+		my ($tmp, %rfopt);
+
+		# determine mime type devoid of explicit value
+		$type ||= Vend::Util::mime_type($opt->{file});
+
+		# avoid encoding of binary files
+		if ($type !~ m{^text/}i) {
+			$rfopt{encoding} = 'raw';
+		}
+
+		$tmp = readfile($opt->{file}, undef, undef, \%rfopt);
 		$out = \$tmp;
 	}
 	elsif(ref $body) {


hooks/post-receive
-- 
Interchange



More information about the interchange-cvs mailing list