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, 6.0 has been updated
       via  f2d1d05cd98c298c641dc2a44b953b57c59eb5ee (commit)
       via  88e3c1d2ba077c513b82fe6f3ecd75dc7ddafa91 (commit)
      from  bdd5414b820dc7b68d628e0edec5d214a76d6431 (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 -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=f2d1d05cd98c298c641dc2a44b953b57c59eb5ee

commit f2d1d05cd98c298c641dc2a44b953b57c59eb5ee
Author: Sylvain Beucler <[email protected]>
Date:   Wed Jun 24 16:47:57 2015 +0200

    lists: fix description encoding depending on Mailman version

diff --git a/src/CHANGES b/src/CHANGES
index 6626fed..10c1872 100644
--- a/src/CHANGES
+++ b/src/CHANGES
@@ -1,3 +1,6 @@
+FusionForge 6.0.2:
+* Mailing lists: fix description encoding depending on Mailman version (Inria 
& Thorsten Glaser)
+
 FusionForge 6.0.1:
 * Accounts: accept elliptic curve ssh keys (Unit 193)
 * Accounts: fix project join request form [#778] (Inria)
diff --git a/src/cronjobs/lists/mailing_lists_create.php 
b/src/cronjobs/lists/mailing_lists_create.php
index 9eb9c31..8de0a57 100755
--- a/src/cronjobs/lists/mailing_lists_create.php
+++ b/src/cronjobs/lists/mailing_lists_create.php
@@ -67,6 +67,19 @@ if (!is_dir(forge_get_config('data_path').'/dumps')) {
 }
 $h1 = fopen(forge_get_config('data_path').'/dumps/mailman-aliases', "w");
 
+# Encoding hell
+if (strpos(file_get_contents($path_to_mailman.'/Mailman/Defaults.py'),
+           "sys.setdefaultencoding('utf-8')")) {
+       # Sniffed utf-8 patch (e.g. in Debian 8)
+       # Consistent encoding:
+       $coding = 'utf-8';
+} else {
+       # Standard Mailman 2.1.x, encoding used depends on the list language
+       # Using heuristic:
+       $coding = 'iso-8859-1';
+       # Alternate fix: iconv('utf-8', 'us-ascii//TRANSLIT', $description);
+}
+
 $mailingListIds = array();
 for ($i=0; $i<$rows; $i++) {
        $listadmin = db_result($res,$i,'user_name');
@@ -77,7 +90,8 @@ for ($i=0; $i<$rows; $i++) {
        $public = db_result($res,$i,'is_public');
        $status = db_result($res,$i,'status');
        $description = db_result($res, $i, 'description');
-       $description = str_replace('"', '\"', utf8_decode($description));
+       if ($coding == 'iso-8859-1') $description = utf8_decode($description);
+       $description = str_replace('"', '\"', $description);
 
        $listname = trim($listname);
        if (!$listname) {
@@ -106,7 +120,7 @@ for ($i=0; $i<$rows; $i++) {
                        echo db_error();
                        $tmp = tempnam(forge_get_config('data_path'), "tmp");
                        $fh = fopen($tmp,'w');
-                       $listConfig = "# -*- coding: iso-8859-1 -*-\n";
+                       $listConfig = "# -*- coding: $coding -*-\n";
                        $listConfig .= "description = \"$description\"\n" ;
                        $listConfig .= "host_name = 
'".forge_get_config('lists_host')."'\n" ;
                        if (!$public) {
@@ -149,7 +163,7 @@ for ($i=0; $i<$rows; $i++) {
        } elseif ($status == MAIL__MAILING_LIST_IS_CREATED) {  // created but 
not configured
                $tmp = tempnam(forge_get_config('data_path'), "tmp");
                $fh = fopen($tmp,'w');
-               $listConfig = "# -*- coding: iso-8859-1 -*-\n";
+               $listConfig = "# -*- coding: $coding -*-\n";
                $listConfig .= "description = \"$description\"\n" ;
                $listConfig .= "host_name = 
'".forge_get_config('lists_host')."'\n";
                if (!$public) {
@@ -185,7 +199,7 @@ for ($i=0; $i<$rows; $i++) {
                $tmp = tempnam(forge_get_config('data_path'), "tmp");
                $tmp = tempnam(forge_get_config('data_path'), "tmp");
                $fh = fopen($tmp,'w');
-               $listConfig = "# -*- coding: iso-8859-1 -*-\n";
+               $listConfig = "# -*- coding: $coding -*-\n";
                $listConfig .= "description = \"$description\"\n" ;
                $listConfig .= "host_name = 
'".forge_get_config('lists_host')."'\n" ;
                if (!$public) {
@@ -238,7 +252,7 @@ for ($i=0; $i<$rows; $i++) {
                        $err .= "Privatizing ".$listname."\n";
                        $tmp = tempnam(forge_get_config('data_path'), "tmp");
                        $fh = fopen($tmp,'w');
-                       $listConfig = "# -*- coding: iso-8859-1 -*-\n";
+                       $listConfig = "# -*- coding: $coding -*-\n";
                        $listConfig .= "description = \"$description\"\n" ;
                        $listConfig .= "host_name = 
'".forge_get_config('lists_host')."'\n" ;
                        $listConfig .= "archive_private = True\n" ;

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=88e3c1d2ba077c513b82fe6f3ecd75dc7ddafa91

commit 88e3c1d2ba077c513b82fe6f3ecd75dc7ddafa91
Author: Sylvain Beucler <[email protected]>
Date:   Wed Jun 24 16:40:30 2015 +0200

    lists: consistent URL rewriting

diff --git a/src/etc/httpd.conf.d/vhost-list.inc 
b/src/etc/httpd.conf.d/vhost-list.inc
index 2518219..cf6cedf 100644
--- a/src/etc/httpd.conf.d/vhost-list.inc
+++ b/src/etc/httpd.conf.d/vhost-list.inc
@@ -5,7 +5,7 @@ SetEnv FF__core__config_path "${FF__core__config_path}"
 IncludeOptional ${FF__core__config_path}/httpd.conf.d/lists-vhost-plugin-*.inc
 
 RewriteEngine on
-RewriteRule ^/$ /cgi-bin/mailman/listinfo [R=301]
+RewriteRule ^/$ /mailman/listinfo [R=301]
 
 ScriptAlias /mailman/ /usr/lib/cgi-bin/mailman/
 

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

Summary of changes:
 src/CHANGES                                 |  3 +++
 src/cronjobs/lists/mailing_lists_create.php | 24 +++++++++++++++++++-----
 src/etc/httpd.conf.d/vhost-list.inc         |  2 +-
 3 files changed, 23 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
FusionForge

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

Reply via email to