Commit 2cb2fc2e authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie

Create sessions when messages are assigned and there is no session.

parent f57ef177
......@@ -151,6 +151,9 @@ class Session {
* @param boolean $escape Whether to HTML escape the message
*/
public function add_ok_msg($message, $escape=true) {
if (empty($_SESSION)) {
$this->create_session();
}
if ($escape) {
$message = htmlspecialchars($message, ENT_COMPAT, 'UTF-8');
$message = str_replace(' ', '  ', $message);
......@@ -165,6 +168,9 @@ class Session {
* @param boolean $escape Whether to HTML escape the message
*/
public function add_info_msg($message, $escape=true) {
if (empty($_SESSION)) {
$this->create_session();
}
if ($escape) {
$message = htmlspecialchars($message, ENT_COMPAT, 'UTF-8');
$message = str_replace(' ', '  ', $message);
......@@ -179,6 +185,9 @@ class Session {
* @param boolean $escape Whether to HTML escape the message
*/
public function add_err_msg($message, $escape=true) {
if (empty($_SESSION)) {
$this->create_session();
}
if ($escape) {
$message = htmlspecialchars($message, ENT_COMPAT, 'UTF-8');
$message = str_replace(' ', '  ', $message);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment