commit please

Anton Nehoroshih anton@valuehost.ru
Wed, 8 Aug 2001 14:04:23 +0400


Patch for internation charset


Index: horde/lib/MIME/Message.php
===================================================================
RCS file: /cvs/horde/horde/lib/MIME/Message.php,v
retrieving revision 1.5
diff -u -c -r1.5 Message.php
*** horde/lib/MIME/Message.php  2001/01/19 03:39:06     1.5
--- horde/lib/MIME/Message.php  2001/08/08 09:44:31
***************
*** 62,68 ****
       */
      function encode($headers)
      {
!         global $HTTP_ACCEPT_CHARSET;
          
          if (!empty($HTTP_ACCEPT_CHARSET)) {
              $charsets = explode(',', $HTTP_ACCEPT_CHARSET);
--- 62,68 ----
       */
      function encode($headers)
      {
!         global $HTTP_ACCEPT_CHARSET,$conf;
          
          if (!empty($HTTP_ACCEPT_CHARSET)) {
              $charsets = explode(',', $HTTP_ACCEPT_CHARSET);
***************
*** 70,76 ****
                  $charset = trim($charsets[0]);
              }
          }
!         if (empty($charset)) $charset = 'ISO-8859-1';
          
          foreach ($headers as $key => $val) {
              if ($key == 'To' || $key == 'Cc' || $key == 'Bcc' || $key == 'From') {
--- 70,82 ----
                  $charset = trim($charsets[0]);
              }
          }
!         if (empty($charset)) {
!           if(empty($conf['lang']['charset']) {
!               $charset = 'ISO-8859-1';
!           } else {
!               $charset = $conf['lang']['charset'];
!           }
!       } 
          
          foreach ($headers as $key => $val) {
              if ($key == 'To' || $key == 'Cc' || $key == 'Bcc' || $key == 'From') {
Index: horde/lib/MIME/Part.php
===================================================================
RCS file: /cvs/horde/horde/lib/MIME/Part.php,v
retrieving revision 1.7
diff -u -c -r1.7 Part.php
*** horde/lib/MIME/Part.php     2001/07/05 20:10:46     1.7
--- horde/lib/MIME/Part.php     2001/08/08 09:44:31
***************
*** 170,175 ****
--- 170,176 ----
       */
      function setEncoding()
      {
B+      global $conf;
          $text = str_replace("\n", ' ', $this->contents);
          // FIXME: dependancy on IMAP module
          if ($this->type == 'text'
***************
*** 188,194 ****
                  }
              }
              
!             if (empty($this->charset)) $charset = 'ISO-8859-1';
          }
      }
      
--- 189,201 ----
                  }
              }
              
!             if (empty($this->charset)) {
!               if(empty($conf['lang']['charset'])) {
!                   $charset = 'ISO-8859-1';
!               } else {
!                   $charset = $conf['lang']['charset'];
!               }
!           } 
          }
      }