| @@ -143,13 +143,9 @@ | ||
| 143 | 143 | if ( empty( $data['tmp_name'] ) ) { |
| 144 | 144 | return new \WP_Error( 'file_error', esc_html__( 'Invalid temporary file path.', 'elementor' ) ); |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | - // Path validation only applies to direct calls (e.g. import_template) where | |
| 148 | - // tmp_name originates from user input. When is_elementor_upload is true, this | |
| 149 | - // method is used as a WordPress filter (wp_handle_sideload_prefilter) and | |
| 150 | - // tmp_name is set by WordPress core. | |
| 151 | - if ( ! $this->is_elementor_upload && ! $this->is_path_in_allowed_dir( $data['tmp_name'] ) ) { | |
| 147 | + if ( ! $this->is_path_in_allowed_dir( $data['tmp_name'] ) ) { | |
| 152 | 148 | return new \WP_Error( 'file_error', esc_html__( 'Invalid temporary file path.', 'elementor' ) ); |
| 153 | 149 | } |
| 154 | 150 | } |
| 155 | 151 | |