[Fusionforge-commits] FusionForge branch Branch_5_3 updated. e7ff6d71ecf3ba3c71a550acf56832386eca0f01

Sylvain Beucler beuc-inria at fusionforge.org
Mon Jun 16 19:49:44 CEST 2014


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 "FusionForge".

The branch, Branch_5_3 has been updated
       via  e7ff6d71ecf3ba3c71a550acf56832386eca0f01 (commit)
      from  f9137bfb0fa6f4d038032fcb301a1afe014b79c8 (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 e7ff6d71ecf3ba3c71a550acf56832386eca0f01
Author: Sylvain Beucler <sylvain.beucler at inria.fr>
Date:   Mon Jun 16 19:49:12 2014 +0200

    git: handle bad encoding when gathering stats

diff --git a/src/CHANGES b/src/CHANGES
index f711fa6..8554ea3 100644
--- a/src/CHANGES
+++ b/src/CHANGES
@@ -1,6 +1,7 @@
 Fusionforge-5.3.2:
 * Software map: fix "value too long for type character varying(255)" error in cron db_trove_maint.php (Inria)
 * SCM Git: suppress 'warning: You appear to have cloned an empty repository.' in create_scm_repos.php (Inria)
+* SCM Git: handle bad encoding when gathering stats (Inria)
 
 Fusionforge-5.3.1:
 * Docman: Basic Webdav write mkcol support (TrivialDev)
diff --git a/src/plugins/scmgit/common/GitPlugin.class.php b/src/plugins/scmgit/common/GitPlugin.class.php
index e1ecb7b..60bdd0e 100644
--- a/src/plugins/scmgit/common/GitPlugin.class.php
+++ b/src/plugins/scmgit/common/GitPlugin.class.php
@@ -745,6 +745,10 @@ class GitPlugin extends SCMPlugin {
 			$last_user    = "";
 			while (!feof($pipe) && $data = fgets($pipe)) {
 				$line = trim($data);
+				// Drop bad UTF-8 - it's quite hard to make git output non-UTF-8
+				// (e.g. by enforcing an unknown encoding) - but some users do!
+				// and this makes PostgreSQL choke
+				$line = preg_replace('/[^(\x20-\x7F)]/','', $line);
 				if (strlen($line) > 0) {
 					$result = preg_match("/^(?P<name>.+) <(?P<mail>.+)>/", $line, $matches);
 					if ($result) {

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

Summary of changes:
 src/CHANGES                                   |    1 +
 src/plugins/scmgit/common/GitPlugin.class.php |    4 ++++
 2 files changed, 5 insertions(+)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list