Viewing 4 replies - 16 through 19 (of 19 total)
  • Thread Starter glushenya

    (@glushenya)

    I solve a problem with SPF and score is low now, but result is the same.

    Return-Path: <****@dovgan.kiev.ua>
    Delivered-To: ****@dovgan.kiev.ua
    Received: from localhost (unknown [**.***.***.***])
    	by mx-out-1.ukraine.com.ua (Postfix) with ESMTPA id 1350F60ABE
    	for <****@dovgan.kiev.ua>; Tue, 31 Mar 2015 22:24:07 +0300 (EEST)
    X-Mailer: Postman SMTP 1.5.10 for WordPress (https://www.ads-software.com/plugins/postman-smtp/)
    Content-Type: multipart/mixed;
     boundary="=_9c76bebf0af3799b0f7723617ab727b3"
    From: admin <****@dovgan.kiev.ua>
    To: ****@dovgan.kiev.ua
    Subject: =?UTF-8?Q?=D0=9D=D0=BE=D0=B2=D0=B0=D1=8F=20=D0=B2=D0=B0=D0=BA=D0=B0=D0=BD=D1=81=D0=B8=D1=8F?=
    Date: Tue, 31 Mar 2015 19:24:06 +0000
    Content-Transfer-Encoding: quoted-printable
    Content-Disposition: inline
    MIME-Version: 1.0
    X-Delta-Virus-Check: ok
    X-Delta-Spam-Symbols: Symbols: ONCE_RECEIVED(1.00), MISSING_MID(3.00);
    X-Delta-Spam-Score: 4
    
    This is a message in Mime Format.  If you see this, your mail reader does not support this format.
    
    --=_9c76bebf0af3799b0f7723617ab727b3
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: quoted-printable
    Content-Disposition: inline
    
    --=_9c76bebf0af3799b0f7723617ab727b3
    Content-Type: application/octet-stream
    Content-Transfer-Encoding: base64
    Content-Disposition: inline; filename="1"
    Thread Starter glushenya

    (@glushenya)

    Maybe the problem in “inline”, not “attachment”. Can it be?
    Content-Disposition: inline; filename="1"

    Hello all. I found out the solution.

    Short answer.
    Put the following line in the beginning of functions.php of your theme:
    setlocale(LC_CTYPE, 'ru_RU.utf8');

    Long answer.
    1. wp-content/plugins/contact-form-7/modules/file.php line 162
    Here is the chain of functions that format the name of file

    $filename = $file['name'];
    $filename = wpcf7_canonicalize( $filename );
    $filename = sanitize_file_name( $filename );
    $filename = wpcf7_antiscript_file_name( $filename );
    $filename = wp_unique_filename( $uploads_dir, $filename );

    Firstly, wpcf7_canonicalize() returns “??????????” instead of filename.
    Secondly, sanitize_file_name() returns “1”.
    Here we are. Obviously, promblem is in wpcf7_canonicalize() function:

    function wpcf7_canonicalize( $text ) {
    	if ( function_exists( 'mb_convert_kana' )
    	&& 'UTF-8' == get_option( 'blog_charset' ) ) {
    		$text = mb_convert_kana( $text, 'asKV', 'UTF-8' );
    	}
    
    	$text = strtolower( $text );
    	$text = trim( $text );
    	return $text;
    }

    Specifically, the problem is the strtolower() function, it returns “????????”, because locale LC_CTYPE is “ru_RU.CP1251” (in my case). It can be checked with setlocale(LC_CTYPE, 0); So, setting UT8-8 solves the problem:
    setlocale(LC_CTYPE, 'ru_RU.utf8');

    Thread Starter glushenya

    (@glushenya)

    Thank you very much, Alex! ?? Great!

Viewing 4 replies - 16 through 19 (of 19 total)
  • The topic ‘Cyrillic filename problem’ is closed to new replies.