1483f044 by Marty Penner

Use new tzClean() function to clean data going into the database and coming out. refs #1372

1 parent 75d82c33
......@@ -69,8 +69,8 @@ function display_page() {
//details
if ($validation->run() == TRUE) {
// Clean up data before saving
Tools\tzClean($_POST);
$type = $_POST['type'];
$title = $_POST['title'];
......@@ -143,16 +143,11 @@ function display_page() {
$entry->email = $email;
$entry->system = $system;
$flash = "<strong>Notification Saved Successfully!</strong><br /><a href='/wp-admin/admin.php?page=notifications'>Click here</a> to view all notifications.</a>";
require_once(__DIR__ . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . 'form.php');
} else {
require_once(__DIR__ . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . 'form.php');
}
} else {
if (isset($_GET['action']) && $_GET['action']=="delete") {
......@@ -188,7 +183,6 @@ function display_page() {
$entries = get_posts($args);
foreach($entries as $entry) {
$id = $entry->ID;
......@@ -216,13 +210,7 @@ function display_page() {
}
require_once(__DIR__ . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . 'admin.php');
}
}
function mysqldatetime_to_timestamp($datetime = "")
......@@ -308,6 +296,9 @@ function create_notification() {
} else {
if ($validation->run() == TRUE) {
// Clean up the data before saving
Tools\tzClean($_POST);
// ok, so now we need to create the notification.
class postTemplate {
var $post_title = '';
......
......@@ -719,7 +719,7 @@ class Validation {
* @access public
* @param string the field name
* @param string
* @return void
* @return mixed
*/
function set_value($field = '', $default = '')
{
......@@ -728,7 +728,7 @@ class Validation {
return $default;
}
return $this->_field_data[$field]['postdata'];
return Tools\tzClean($this->_field_data[$field]['postdata']);
}
// --------------------------------------------------------------------
......