Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wp-cli-cron-control-offload
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
WP Plugins
wp-cli-cron-control-offload
Commits
43883c8a
Commit
43883c8a
authored
7 years ago
by
Erick Hitter
Browse files
Options
Downloads
Patches
Plain Diff
Simplify how the whitelist is applied
If someone wants to run without a whitelist, hook `__return_true`.
parent
7fc1f2cd
Branches
develop
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
includes/functions.php
+3
-16
3 additions, 16 deletions
includes/functions.php
with
3 additions
and
16 deletions
includes/functions.php
+
3
−
16
View file @
43883c8a
...
@@ -85,23 +85,10 @@ function is_command_allowed( $command ) {
...
@@ -85,23 +85,10 @@ function is_command_allowed( $command ) {
return
false
;
return
false
;
}
}
// If there's a whitelist, default to it.
// Default to command whitelist.
if
(
!
empty
(
get_command_whitelist
()
)
)
{
$whitelisted
=
in_array
(
$command
,
get_command_whitelist
(),
true
);
add_filter
(
'wp_cli_cron_control_offload_is_command_allowed'
,
__NAMESPACE__
.
'\command_is_whitelisted'
,
9
,
2
);
}
return
apply_filters
(
'wp_cli_cron_control_offload_is_command_allowed'
,
true
,
$command
);
}
/**
return
apply_filters
(
'wp_cli_cron_control_offload_is_command_allowed'
,
$whitelisted
,
$command
);
* Filter callback to check a command against a whitelist
*
* @param bool $whitelisted Command is allowed.
* @param string $command Command to check.
* @return bool
*/
function
command_is_whitelisted
(
$whitelisted
,
$command
)
{
return
in_array
(
$command
,
get_command_whitelist
(),
true
);
}
}
/**
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment