Use new tzClean() function to clean data going into the database and coming out. refs #1372
Showing
2 changed files
with
9 additions
and
18 deletions
| ... | @@ -68,10 +68,10 @@ function display_page() { | ... | @@ -68,10 +68,10 @@ function display_page() { |
| 68 | 68 | ||
| 69 | //details | 69 | //details |
| 70 | if ($validation->run() == TRUE) { | 70 | if ($validation->run() == TRUE) { |
| 71 | 71 | ||
| 72 | 72 | // Clean up data before saving | |
| 73 | 73 | Tools\tzClean($_POST); | |
| 74 | 74 | ||
| 75 | $type = $_POST['type']; | 75 | $type = $_POST['type']; |
| 76 | $title = $_POST['title']; | 76 | $title = $_POST['title']; |
| 77 | $sendto = $_POST['sendto']; | 77 | $sendto = $_POST['sendto']; |
| ... | @@ -143,16 +143,11 @@ function display_page() { | ... | @@ -143,16 +143,11 @@ function display_page() { |
| 143 | $entry->email = $email; | 143 | $entry->email = $email; |
| 144 | $entry->system = $system; | 144 | $entry->system = $system; |
| 145 | 145 | ||
| 146 | |||
| 147 | |||
| 148 | $flash = "<strong>Notification Saved Successfully!</strong><br /><a href='/wp-admin/admin.php?page=notifications'>Click here</a> to view all notifications.</a>"; | 146 | $flash = "<strong>Notification Saved Successfully!</strong><br /><a href='/wp-admin/admin.php?page=notifications'>Click here</a> to view all notifications.</a>"; |
| 149 | require_once(__DIR__ . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . 'form.php'); | 147 | require_once(__DIR__ . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . 'form.php'); |
| 150 | } else { | 148 | } else { |
| 151 | require_once(__DIR__ . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . 'form.php'); | 149 | require_once(__DIR__ . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . 'form.php'); |
| 152 | } | 150 | } |
| 153 | |||
| 154 | |||
| 155 | |||
| 156 | } else { | 151 | } else { |
| 157 | 152 | ||
| 158 | if (isset($_GET['action']) && $_GET['action']=="delete") { | 153 | if (isset($_GET['action']) && $_GET['action']=="delete") { |
| ... | @@ -188,7 +183,6 @@ function display_page() { | ... | @@ -188,7 +183,6 @@ function display_page() { |
| 188 | $entries = get_posts($args); | 183 | $entries = get_posts($args); |
| 189 | 184 | ||
| 190 | 185 | ||
| 191 | |||
| 192 | foreach($entries as $entry) { | 186 | foreach($entries as $entry) { |
| 193 | $id = $entry->ID; | 187 | $id = $entry->ID; |
| 194 | 188 | ||
| ... | @@ -216,13 +210,7 @@ function display_page() { | ... | @@ -216,13 +210,7 @@ function display_page() { |
| 216 | } | 210 | } |
| 217 | 211 | ||
| 218 | require_once(__DIR__ . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . 'admin.php'); | 212 | require_once(__DIR__ . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . 'admin.php'); |
| 219 | |||
| 220 | |||
| 221 | |||
| 222 | } | 213 | } |
| 223 | |||
| 224 | |||
| 225 | |||
| 226 | } | 214 | } |
| 227 | 215 | ||
| 228 | function mysqldatetime_to_timestamp($datetime = "") | 216 | function mysqldatetime_to_timestamp($datetime = "") |
| ... | @@ -308,6 +296,9 @@ function create_notification() { | ... | @@ -308,6 +296,9 @@ function create_notification() { |
| 308 | } else { | 296 | } else { |
| 309 | if ($validation->run() == TRUE) { | 297 | if ($validation->run() == TRUE) { |
| 310 | 298 | ||
| 299 | // Clean up the data before saving | ||
| 300 | Tools\tzClean($_POST); | ||
| 301 | |||
| 311 | // ok, so now we need to create the notification. | 302 | // ok, so now we need to create the notification. |
| 312 | class postTemplate { | 303 | class postTemplate { |
| 313 | var $post_title = ''; | 304 | var $post_title = ''; | ... | ... |
| ... | @@ -719,7 +719,7 @@ class Validation { | ... | @@ -719,7 +719,7 @@ class Validation { |
| 719 | * @access public | 719 | * @access public |
| 720 | * @param string the field name | 720 | * @param string the field name |
| 721 | * @param string | 721 | * @param string |
| 722 | * @return void | 722 | * @return mixed |
| 723 | */ | 723 | */ |
| 724 | function set_value($field = '', $default = '') | 724 | function set_value($field = '', $default = '') |
| 725 | { | 725 | { |
| ... | @@ -728,7 +728,7 @@ class Validation { | ... | @@ -728,7 +728,7 @@ class Validation { |
| 728 | return $default; | 728 | return $default; |
| 729 | } | 729 | } |
| 730 | 730 | ||
| 731 | return $this->_field_data[$field]['postdata']; | 731 | return Tools\tzClean($this->_field_data[$field]['postdata']); |
| 732 | } | 732 | } |
| 733 | 733 | ||
| 734 | // -------------------------------------------------------------------- | 734 | // -------------------------------------------------------------------- | ... | ... |
-
Please register or sign in to post a comment