- using slashes in the callback function setting of the dropdown fields;

This commit is contained in:
Nikita Sinelnikov
2022-06-08 21:24:23 +03:00
parent f46a382532
commit fe88b40939
8 changed files with 60 additions and 35 deletions
+2 -1
View File
@@ -132,13 +132,14 @@ if ( ! class_exists( 'um\core\Form' ) ) {
}
$allowed_callbacks = UM()->options()->get( 'allowed_choice_callbacks' );
if ( empty( $allowed_callbacks ) ) {
$arr_options['status'] = 'error';
$arr_options['message'] = __( 'This is not possible for security reasons.', 'ultimate-member' );
wp_send_json( $arr_options );
}
$allowed_callbacks = array_map( 'rtrim', explode( "\n", $allowed_callbacks ) );
$allowed_callbacks = array_map( 'rtrim', explode( "\n", wp_unslash( $allowed_callbacks ) ) );
if ( ! in_array( $ajax_source_func, $allowed_callbacks, true ) ) {
$arr_options['status'] = 'error';