PluginProbe
Elementor Website Builder – more than just a page builder / 3.13.3
Elementor Website Builder – more than just a page builder v3.13.3
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | core/common/modules/ajax/module.php +12 -4 4.2.13.13.3 View file →
@@ -171,10 +171,9 @@
171 171 $action_data['data']['editor_post_id'] = $editor_post_id;
172 172 }
173 173
174 174 try {
175 - $data = $action_data['data'] ?? [];
176 - $results = call_user_func( $this->ajax_actions[ $action_data['action'] ]['callback'], $data, $this );
175 + $results = call_user_func( $this->ajax_actions[ $action_data['action'] ]['callback'], $action_data['data'], $this );
177 176
178 177 if ( false === $results ) {
179 178 $this->add_response_data( false );
180 179 } else {
@@ -265,10 +264,19 @@
265 264 while ( ob_get_status() ) {
266 265 ob_end_clean();
267 266 }
268 267
269 - header( 'Content-Type: application/json; charset=UTF-8' );
270 - echo $json; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
268 + if ( function_exists( 'gzencode' ) ) {
269 + $response = gzencode( $json );
270 +
271 + header( 'Content-Type: application/json; charset=utf-8' );
272 + header( 'Content-Encoding: gzip' );
273 + header( 'Content-Length: ' . strlen( $response ) );
274 +
275 + echo $response; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
276 + } else {
277 + echo $json; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
278 + }
271 279
272 280 wp_die( '', '', [ 'response' => null ] );
273 281 }
274 282