1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-09 16:17:14 +02:00

Merge pull request #228 from Deltik/master

[security] Protection for exposed emails, Message-Handler constants etc. Thank you Deltik
This commit is contained in:
Cameron
2013-05-10 16:21:38 -07:00
5 changed files with 51 additions and 11 deletions

View File

@@ -18,6 +18,10 @@ if (!defined('e107_INIT')) { exit; }
/*
* Type defines
* XXX - convert to eMessage class constants
* @note 07 May 2013: These have been converted to eMessage class constants!
* Example: eMessage::E_MESSAGE_SUCCESS is 'success'
* -- Deltik
* P.S. Now somebody needs to get rid of these universal constants...
*/
define('E_MESSAGE_INFO', 'info');
define('E_MESSAGE_SUCCESS', 'success');
@@ -39,6 +43,17 @@ define('E_MESSAGE_NODISPLAY', 'nodisplay'); // Appears to be needed by update_ro
*/
class eMessage
{
/**
* Type defines
*/
const E_INFO = 'info';
const E_SUCCESS = 'success';
const E_WARNING = 'warning';
const E_ERROR = 'error';
const E_DEBUG = 'debug';
const E_NODISPLAY = 'nodisplay';
/**
* System Message Array
* in format [type][message_stack] = array(message[, ...])
@@ -172,7 +187,7 @@ class eMessage
* @param boolean $session
* @return eMessage
*/
public function add($message, $type = E_MESSAGE_INFO, $session = false)
public function add($message, $type = eMessage::E_INFO, $session = false)
{
if(empty($message)) return $this;
@@ -997,4 +1012,4 @@ function show_emessage($mode, $message, $line = 0, $file = "") {
}
}
?>
?>