Browse Source

Prevent email header injection

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1573 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 13 năm trước cách đây
mục cha
commit
caf9a6a74a
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      core/email.class.inc.php

+ 2 - 2
core/email.class.inc.php

@@ -86,8 +86,8 @@ class EMail
 		set_error_handler(array($this, 'mail_error_handler'));
 		$bRes = mail
 		(
-			$this->m_sTo,
-			$this->m_sSubject,
+			str_replace(array("\n", "\r"), ' ', $this->m_sTo), // Prevent header injection
+			str_replace(array("\n", "\r"), ' ', $this->m_sSubject), // Prevent header injection
 			$this->m_sBody,
 			$sHeaders
 		);