Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Markus Hermann
wp-polls
Commits
53a45aec
Unverified
Commit
53a45aec
authored
Mar 23, 2019
by
Lester Chan
Browse files
Add whitelist to sortby poll answers
parent
f8b4a00a
Changes
1
Hide whitespace changes
Inline
Side-by-side
polls-options.php
View file @
53a45aec
...
...
@@ -60,7 +60,7 @@ if( isset($_POST['Submit']) && $_POST['Submit'] ) {
'loading'
=>
isset
(
$_POST
[
'poll_ajax_style_loading'
]
)
?
(
int
)
sanitize_key
(
$_POST
[
'poll_ajax_style_loading'
]
)
:
1
,
'fading'
=>
isset
(
$_POST
[
'poll_ajax_style_fading'
]
)
?
(
int
)
sanitize_key
(
$_POST
[
'poll_ajax_style_fading'
]
)
:
1
);
$poll_ans_sortby
=
isset
(
$_POST
[
'poll_ans_sortby'
]
)
&&
in_array
(
$_POST
[
'poll_ans_sortby'
],
array
(
'polla_aid'
,
'polla_answers'
,
'RAND()'
),
true
)
?
$_POST
[
'poll_ans_sortby'
]
:
'polla_aid'
;
$poll_ans_sortby
=
isset
(
$_POST
[
'poll_ans_sortby'
]
)
&&
in_array
(
$_POST
[
'poll_ans_sortby'
],
array
(
'polla_votes'
,
'polla_aid'
,
'polla_answers'
,
'RAND()'
),
true
)
?
$_POST
[
'poll_ans_sortby'
]
:
'polla_aid'
;
$poll_ans_sortorder
=
isset
(
$_POST
[
'poll_ans_sortorder'
]
)
&&
in_array
(
$_POST
[
'poll_ans_sortorder'
],
array
(
'asc'
,
'desc'
),
true
)
?
$_POST
[
'poll_ans_sortorder'
]
:
'asc'
;
$poll_ans_result_sortby
=
isset
(
$_POST
[
'poll_ans_result_sortby'
]
)
&&
in_array
(
$_POST
[
'poll_ans_result_sortby'
],
array
(
'polla_votes'
,
'polla_aid'
,
'polla_answers'
,
'RAND()'
),
true
)
?
$_POST
[
'poll_ans_result_sortby'
]
:
'polla_votes'
;
$poll_ans_result_sortorder
=
isset
(
$_POST
[
'poll_ans_result_sortorder'
]
)
&&
in_array
(
$_POST
[
'poll_ans_result_sortorder'
],
array
(
'asc'
,
'desc'
),
true
)
?
$_POST
[
'poll_ans_result_sortorder'
]
:
'desc'
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment