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
75d82c33
authored
2011-11-11 21:27:54 -0500
by
Marty Penner
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Add function that "cleans" double backslashes and escaped quotes. refs #1372
1 parent
e8f47b53
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
tz-tools.php
tz-tools.php
View file @
75d82c3
...
...
@@ -88,6 +88,32 @@ function tools_url() {
}
/**
* "Cleans" data by removing double backslashes and escaped quotes. Will run recursively on arrays.
*
* @param $data array|string Data to clean
* @return array|string
*/
function
tzClean
(
&
$data
)
{
if
(
is_array
(
$data
))
{
foreach
(
$data
as
$index
=>
$child_data
)
{
tzClean
(
$data
[
$index
]);
}
}
else
{
$data
=
str_ireplace
(
'\\'
,
''
,
str_ireplace
(
array
(
'\"'
,
"\'"
),
array
(
'"'
,
"'"
),
$data
)
);
}
return
$data
;
}
/**
* @returns {WP_User} of the currently logged in user
*/
function
getCurrentUser
()
{
...
...
Please
register
or
sign in
to post a comment