浏览代码

Security measure in debug mode.

euromark 11 年之前
父节点
当前提交
eb7120bfac
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      Lib/EmailLib.php

+ 6 - 0
Lib/EmailLib.php

@@ -447,6 +447,12 @@ class EmailLib extends CakeEmail {
 			//$this->_headers['Importance'] = 'High';
 		}
 
+		// Security measure to not sent to the actual addressee in debug mode
+		if (Configure::read('debug')) {
+			$this->to(Configure::read('Config.adminEmail'), Configure::read('Config.adminName'));
+			$this->_cc = $this->_bcc = array();
+		}
+
 		try {
 			$this->_debug = parent::send($message);
 		} catch (Exception $e) {