Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[smtp_code_ex] bad encoding #3032

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/PHPMailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4192,6 +4192,15 @@
$msg .= ' ' . $this->lang('smtp_code') . $lasterror['smtp_code'];
}
if (!empty($lasterror['smtp_code_ex'])) {
if(function_exists('mb_detect_encoding')):

Check failure on line 4195 in src/PHPMailer.php

View workflow job for this annotation

GitHub Actions / Coding standards

Expected 1 space after IF keyword; 0 found

Check failure on line 4195 in src/PHPMailer.php

View workflow job for this annotation

GitHub Actions / Coding standards

Expected 1 space after closing parenthesis; found 0
$charset = strtoupper(ini_get('default_charset'));
if($charset):

Check failure on line 4197 in src/PHPMailer.php

View workflow job for this annotation

GitHub Actions / Coding standards

Expected 1 space after IF keyword; 0 found

Check failure on line 4197 in src/PHPMailer.php

View workflow job for this annotation

GitHub Actions / Coding standards

Expected 1 space after closing parenthesis; found 0
$encoding = mb_detect_encoding($lasterror['smtp_code_ex'],array($charset,'GB18030','CP936','UTF-8'),true);

Check failure on line 4198 in src/PHPMailer.php

View workflow job for this annotation

GitHub Actions / Coding standards

No space found after comma in argument list

Check failure on line 4198 in src/PHPMailer.php

View workflow job for this annotation

GitHub Actions / Coding standards

No space found after comma in argument list

Check warning on line 4198 in src/PHPMailer.php

View workflow job for this annotation

GitHub Actions / Coding standards

Line exceeds 120 characters; contains 134 characters
if($encoding&&$charset != $encoding):

Check failure on line 4199 in src/PHPMailer.php

View workflow job for this annotation

GitHub Actions / Coding standards

Expected 1 space after IF keyword; 0 found

Check failure on line 4199 in src/PHPMailer.php

View workflow job for this annotation

GitHub Actions / Coding standards

Expected at least 1 space before "&&"; 0 found

Check failure on line 4199 in src/PHPMailer.php

View workflow job for this annotation

GitHub Actions / Coding standards

Expected at least 1 space after "&&"; 0 found

Check failure on line 4199 in src/PHPMailer.php

View workflow job for this annotation

GitHub Actions / Coding standards

Expected 1 space after closing parenthesis; found 0
$lasterror['smtp_code_ex'] = mb_convert_encoding($lasterror['smtp_code_ex'],$charset,$encoding);

Check warning on line 4200 in src/PHPMailer.php

View workflow job for this annotation

GitHub Actions / Coding standards

Line exceeds 120 characters; contains 128 characters
endif;
endif;
endif;
$msg .= ' ' . $this->lang('smtp_code_ex') . $lasterror['smtp_code_ex'];
}
}
Expand Down