- added callbacks blacklist. Added PHP command execution functions here to exclude the running them from the custom callback;

This commit is contained in:
Nikita Sinelnikov
2022-09-30 12:31:40 +03:00
parent e1bc94c110
commit aa6a238c61
6 changed files with 75 additions and 31 deletions
@@ -1220,6 +1220,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
$arr_options['function_exists'] = function_exists( $um_callback_func );
}
if ( in_array( $um_callback_func, UM()->fields()->dropdown_options_source_blacklist(), true ) ) {
wp_send_json_error( __( 'This is not possible for security reasons. Don\'t use internal PHP functions.', 'ultimate-member' ) );
}
$arr_options['data'] = array();
if ( function_exists( $um_callback_func ) ) {
$arr_options['data'] = call_user_func( $um_callback_func );