FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » nntp charset problems
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: nntp charset problems [message #158969 is a reply to message #158929] Mon, 20 April 2009 08:59 Go to previous messageGo to previous message
webmaster_at_naszojciec is currently offline  webmaster_at_naszojciec   Poland
Messages: 4
Registered: April 2009
Karma:
Junior Member
Here it is, nntp.inc only:

<?php
--- nntp.inc.1.79       2009-04-20 10:49:14.000000000 +0200
+++ nntp.inc    2009-04-20 10:56:27.000000000 +0200
@@ -162,+162,@@
        function 
format_headers()
        {
                
/* convert to unix line endings and handle multi-line headers */
-               $this->headers str_replace(array("\r\n""\n "), array("\n",""), $this->headers);
+               
$this->headers str_replace("\r\n","\n"$this->headers);
+               
$this->headers preg_replace("/\n(\t| )+/"' '$this->headers);

                
$hdr explode("\n"trim($this->headers));
                
$this->headers = array();
@@ -
402,12 +403,15 @@
                                }
                        }

-                       if (isset(
$this->headers['content-type']) && preg_match('!charset="([^"]+)"!'$this->headers['content-type'], $m)) {
+                       if (isset(
$this->headers['content-type']) && preg_match('!charset="?([^"]+?)"?(;|\s|$)!'$this->headers['content-type'], $m)) {
                                
$charset $m[1];
                        } else {
                                
$charset $GLOBALS['CHARSET'];
                        }
-                       if (isset(
$this->headers['content-transfer-encoding']) && $this->headers['content-transfer-encoding'] == 'quoted-printable') {
+                       if (isset(
$this->headers['content-transfer-encoding']) &&
+                               (
$this->headers['content-transfer-encoding'] == 'quoted-printable'
+                                       || $this->headers['content-transfer-encoding'] == 'base64')
+                               ) {
                                
$enc $this->headers['content-transfer-encoding'];
                        } else {
                                
$enc '';
@@ -
546,+550,@@

                
fputs($this->fs"From: $from\r\n");
                
fputs($this->fs"Newsgroups: $this->newsgroup\r\n");
-               
fputs($this->fs"Subject: $subject\r\n");
+               
fputs($this->fsiconv_mime_encode("Subject"$subject,
+                               array(
'scheme'=>'Q'"input-charset"=>$GLOBALS['CHARSET'],"output-charset"=>$GLOBALS['CHARSET']))
+                               .
"\r\n");

                if (
$GLOBALS['FORUM_TITLE']) {
                        
fputs($this->fs"Organization: ".$GLOBALS['FORUM_TITLE']."\r\n");
?>

[Updated on: Mon, 20 April 2009 08:59]

Report message to a moderator

[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: HELP! Cannot login with exact username and password
Next Topic: Fud API Error
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 27 18:28:36 GMT 2024

Total time taken to generate the page: 0.05295 seconds