Skip to content

Commit

Permalink
MODXMailerにて一部エンティティ文字のサニタイズ回避
Browse files Browse the repository at this point in the history
&#39 「'」 アポストロフィ
&#145 「‘」 左のシングルクォーテーション
&#146 「’」 右のシングルクォーテーション
&#34 「"」 ダブルクォーテーション
&#147 「“」 左のダブルクォーテーション
&#148 「”」 右のダブルクォーテーション
  • Loading branch information
Fiberalph committed May 25, 2015
1 parent bb81d9c commit 0d52f45
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions manager/includes/extenders/modxmailer.class.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,17 @@ public function Send() {
if(strpos($this->Body, $sanitize_seed)!==false) $this->Body = str_replace($sanitize_seed, '', $this->Body);
if(strpos($this->Subject, $sanitize_seed)!==false) $this->Subject = str_replace($sanitize_seed, '', $this->Subject);

$target = array(
"sanitized_by_modx& #039"=>"'",
"sanitized_by_modx& #145"=>"'",
"sanitized_by_modx& #146"=>"'",
"sanitized_by_modx& #034"=>"\"",
"sanitized_by_modx& #147"=>"\"",
"sanitized_by_modx& #148"=>"\"",
"""=>"\""
);
$this->Body = str_replace(array_keys($target), array_values($target), $this->Body);

try {
if(!$this->PreSend()) return false;
return $this->PostSend();
Expand Down

0 comments on commit 0d52f45

Please sign in to comment.