Skip to content

Commit

Permalink
Update mail.php
Browse files Browse the repository at this point in the history
更新PHP版本低于5.4 ,导致发送邮件失败问题
  • Loading branch information
hyjk555 authored May 30, 2018
1 parent 36d8924 commit dae89e8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ function send_mail($xss_record_json) {
$subject = "GET:" . count($xss_record_json['get_data']) . "个 POST:" . count($xss_record_json['post_data']) . "个 Cookie:" . count($xss_record_json['cookie_data']) . "";

$body = json_encode($xss_record_json, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
if (!isset($body))$body=json_encode($xss_record_json); //如果PHP 版本低于5.4会不支持json_encode上面的参数.会初始化内容失败.导致无法发送邮件
$body = str_replace("\n", "<br/>", $body);
$body = str_replace(" ", "&nbsp;", $body);

Expand Down Expand Up @@ -37,4 +38,4 @@ function send_mail($xss_record_json) {

$mail->Body = $body;
$mail->Send();
}
}

0 comments on commit dae89e8

Please sign in to comment.