Merge remote-tracking branch 'remotes/origin/fix/helpscout#33012_ajax_image_upload'

This commit is contained in:
nikitasinelnikov
2019-08-23 22:52:17 +03:00
+2 -1
View File
@@ -286,6 +286,7 @@ if ( ! class_exists( 'um\core\Files' ) ) {
wp_send_json_error( esc_js( __( 'Invalid coordinates', 'ultimate-member' ) ) );
}
$user_id = empty( $_REQUEST['user_id'] ) ? get_current_user_id() : $_REQUEST['user_id'];
$image_path = um_is_file_owner( $src, $user_id, true );
if ( ! $image_path ) {
wp_send_json_error( esc_js( __( 'Invalid file ownership', 'ultimate-member' ) ) );
@@ -312,7 +313,7 @@ if ( ! class_exists( 'um\core\Files' ) ) {
$id = $_POST['key'];
$timestamp = $_POST['timestamp'];
$nonce = $_POST['_wpnonce'];
$user_id = $_POST['user_id'];
$user_id = empty( $_POST['user_id'] ) ? get_current_user_id() : $_POST['user_id'];
UM()->fields()->set_id = $_POST['set_id'];
UM()->fields()->set_mode = $_POST['set_mode'];