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
a96312e7
authored
2021-02-09 15:04:45 -0500
by
Jeff Balicki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
search changed for wp_capabilities
1 parent
d597e791
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
lib/UserSearch.php
lib/UserSearch.php
View file @
a96312e
...
...
@@ -48,6 +48,13 @@ class UserSearch implements ArrayAccess, Iterator, Countable {
$having
=
" HAVING `json` LIKE "
;
if
(
is_array
(
$field_match
)
&&
count
(
$field_match
)
>
0
)
{
foreach
(
$field_match
as
$key
=>
$val
)
{
if
(
$key
==
'wp_capabilities'
){
$pieces
=
explode
(
"
\"
"
,
$val
);
$pieces
=
explode
(
"
\\
"
,
$pieces
[
1
]);
$key
=
$pieces
[
0
];
$having_clause
.=
(
empty
(
$having_clause
)
?
$having
:
"
\n
AND `json` LIKE "
);
$having_clause
.=
" '%
{
$key
}
%' "
;
}
else
{
if
(
!
in_array
(
$key
,
$this
->
fields
))
{
$this
->
fields
[]
=
$key
;
}
...
...
@@ -56,6 +63,7 @@ class UserSearch implements ArrayAccess, Iterator, Countable {
$having_clause
.=
" '%
\"
{
$key
}
\"
:
\"
{
$val
}
%' "
;
}
}
}
// Open ended search
if
(
!
is_null
(
$text_search
))
{
...
...
Please
register
or
sign in
to post a comment