Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Tenzing
/
Tz Tools
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
1483f044
authored
2011-11-11 21:28:31 -0500
by
Marty Penner
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Use new tzClean() function to clean data going into the database and coming out. refs #1372
1 parent
75d82c33
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
18 deletions
com/Notifications/Admin.php
com/Notifications/Validation.php
com/Notifications/Admin.php
View file @
1483f04
...
...
@@ -68,10 +68,10 @@ function display_page() {
//details
if
(
$validation
->
run
()
==
TRUE
)
{
// Clean up data before saving
Tools\tzClean
(
$_POST
);
$type
=
$_POST
[
'type'
];
$title
=
$_POST
[
'title'
];
$sendto
=
$_POST
[
'sendto'
];
...
...
@@ -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
=
''
;
...
...
com/Notifications/Validation.php
View file @
1483f04
...
...
@@ -719,7 +719,7 @@ class Validation {
* @access public
* @param string the field name
* @param string
* @return
voi
d
* @return
mixe
d
*/
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'
])
;
}
// --------------------------------------------------------------------
...
...
Please
register
or
sign in
to post a comment