#2073 Problem with html special chars in subject

closed-fixed
Compose (426)
5
2014-08-12
2006-03-29
Santyaga_ru_RU
No

and when forwarding in body:
SM 1.5.1, PHP 5.
If you try to reply on mail which have in subject
something '->' then you can see on compose window in
Subject input '-≶' then, when send it was not
convert and your recipent get this in subject instead
of '->'. When forwarding, this appear in body. "Draft",
"replay all" -- everywhere this bug present...
My patch:
--- compose.php.old
+++ compose.php.new
@@ -269,7 +269,7 @@

// using own str_pad function in order to create
correct string pad
$bodyTop = sq_str_pad(' '._("Original Message").'
',$editor_size -2,'-',STR_PAD_BOTH,$default_charset) .
- "\n". $display[_("Subject")] . $subject . "\n" .
+ "\n". $display[_("Subject")] .
html_entity_decode($subject) . "\n" . //patched by Santyaga
$display[_("From")] . $from . "\n" .
$display[_("Date")] . getLongDateString(
$orig_header->date ). "\n" .
$display[_("To")] . $to . "\n";
@@ -923,6 +923,7 @@
session_write_close();
sqimap_logout($imapConnection);
}
+ $subject = html_entity_decode($subject); //patched
by Santyaga
$ret = array( 'send_to' => $send_to,
'send_to_cc' => $send_to_cc,
'send_to_bcc' => $send_to_bcc,

WBR,
Santyaga_RU

Discussion

  • Logged In: YES
    user_id=285765

    Hello,

    Thanks for the patch. However, I'm not able to reproduce the
    problem. Are you perhaps using any plugins? If so, does
    disabling the plugins help?

     
  • Tomas Kuliavas
    Tomas Kuliavas
    2006-04-10

    Logged In: YES
    user_id=225877

    Please provide more information about email headers (message
    source or at least encoded header), used PHP recode and
    iconv settings in SquirrelMail configuration utility Tweaks
    section. Please provide full PHP version number and
    configure line.

     
  • Santyaga_ru_RU
    Santyaga_ru_RU
    2006-04-11

    Logged In: YES
    user_id=1456625

    Sorry, I was busy...
    So...
    a) PHP recode and iconv settings:
    PHP tweaks
    4. Use php recode functions : false
    5. Use php iconv functions : false

    b) PHP Version 5.1.2-gentoo

    c) Configure Command './configure'
    '--prefix=/usr/lib/php5' '--sysconfdir=/etc'
    '--cache-file=./config.cache' '--disable-cli'
    '--with-apxs2=/usr/sbin/apxs2'
    '--with-config-file-path=/etc/php/apache2-php5'
    '--with-config-file-scan-dir=/etc/php/apache2-php5/ext-active'
    '--without-pear' '--disable-bcmath' '--with-bz2'
    '--disable-calendar' '--disable-ctype' '--with-curl'
    '--without-curlwrappers' '--disable-dbase' '--disable-exif'
    '--without-fbsql' '--without-fdftk' '--disable-filepro'
    '--disable-ftp' '--with-gettext' '--with-gmp'
    '--disable-hash' '--without-hwapi' '--without-iconv'
    '--without-informix' '--disable-ipv6' '--without-kerberos'
    '--enable-mbstring' '--with-mcrypt' '--disable-memory-limit'
    '--with-mhash' '--without-ming' '--without-msql'
    '--without-mssql' '--with-ncurses' '--with-openssl'
    '--with-openssl-dir=/usr' '--disable-pcntl' '--disable-pdo'
    '--without-pgsql' '--disable-posix' '--without-pspell'
    '--without-recode' '--disable-reflection'
    '--disable-simplexml' '--disable-shmop' '--without-snmp'
    '--disable-soap' '--disable-sockets' '--disable-spl'
    '--without-sybase' '--without-sybase-ct' '--disable-sysvmsg'
    '--disable-sysvsem' '--disable-sysvshm' '--without-tidy'
    '--disable-tokenizer' '--disable-wddx' '--disable-xmlreader'
    '--disable-xmlwriter' '--with-xmlrpc' '--without-xsl'
    '--with-zlib' '--disable-debug' '--enable-dba'
    '--without-cdb' '--with-db4' '--without-flatfile'
    '--with-gdbm' '--without-inifile' '--without-qdbm'
    '--with-freetype-dir=/usr' '--with-t1lib=/usr'
    '--disable-gd-jis-conv' '--enable-gd-native-ttf'
    '--with-jpeg-dir=/usr' '--with-png-dir=/usr'
    '--without-xpm-dir' '--with-gd' '--with-imap'
    '--with-imap-ssl' '--with-ldap' '--without-ldap-sasl'
    '--with-mysql=/usr/lib/mysql'
    '--with-mysql-sock=/var/run/mysqld/mysqld.sock'
    '--without-mysqli' '--with-readline' '--without-libedit'
    '--without-mm' '--enable-sqlite-utf8'

    d) My system locale ru_RU.utf-8, so for SM:
    Language settings
    1. Default Language : ru_RU
    2. Default Charset : utf-8
    3. Show alternative language names : true
    4. Enable aggressive decoding : false
    5. Enable lossy encoding : false

    e) I repair old version of compose.php
    That I can see when testing this bug:

    Павел Семененко 11 Апр 2006 Re: test -> test
    Павел Семененко 11 Апр 2006 test -> test
    Павел Семененко 11 Апр 2006 Re: проверка -> проверка
    Павел Семененко 11 Апр 2006 проверка -> проверка

    That is if subject is in English -- all OK. But if it is in
    Russian you'll can see -> instead -> in replay. Subjects
    are equivalent but in different languages. And this appear
    in composing replay message, and if I don't correct it
    manually I recieve it with this characters. Then they'll be
    multiplying because of & will be changed on & etc...
    Here subjects of this messages:
    1. russian 1 recieve:
    Subject:
    =?utf-8?B?0L/RgNC+0LLQtdGA0LrQsCAtPiDQv9GA0L7QstC10YDQutCw?=
    (decoded equivalent: Тема: проверка -> проверка)
    russian reply:
    Subject:
    =?utf-8?B?UmU6INC/0YDQvtCy0LXRgNC60LAgLSZndDsg0L/RgNC+0LLQtdGA0LrQsA==?=
    (decoded equivalent: Тема: Re: проверка -> проверка)

    I hope I answered on all your questions.
    Anything else? -- ask me...

     
  • Tomas Kuliavas
    Tomas Kuliavas
    2006-04-23

    Logged In: YES
    user_id=225877

    see attached initial patch for functions/mime.php file.

    It should fix issue with invalid encoding when $decide
    option is set to true.

    kink: in order to reproduce it, you must have
    $lossy_encoding enabled or use utf-8.

     
  • Tomas Kuliavas
    Tomas Kuliavas
    2006-04-23

    • assigned_to: nobody --> tokul
     
  • Tomas Kuliavas
    Tomas Kuliavas
    2006-04-23

    test patch (2006-04-23)

     
    Attachments
  • Tomas Kuliavas
    Tomas Kuliavas
    2006-04-24

    Logged In: YES
    user_id=225877

    Fixed in 1.4.7cvs and 1.5.2cvs.

     
  • Tomas Kuliavas
    Tomas Kuliavas
    2006-04-24

    • status: open --> closed-fixed