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 <[email protected]>
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

_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to