#2073 Problem with html special chars in subject

Compose (426)

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 @@
+ $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,



  • Thijs Kinkhorst

    Thijs Kinkhorst - 2006-04-05

    Logged In: YES


    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

    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

    Sorry, I was busy...
    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'
    '--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'
    '--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:
    (decoded equivalent: Тема: проверка -> проверка)
    russian reply:
    (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

    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)

  • Tomas Kuliavas

    Tomas Kuliavas - 2006-04-24

    Logged In: YES

    Fixed in 1.4.7cvs and 1.5.2cvs.

  • Tomas Kuliavas

    Tomas Kuliavas - 2006-04-24
    • status: open --> closed-fixed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks