PluginProbe
GetResponse Forms by Optin Cat / 1.3.6
GetResponse Forms by Optin Cat v1.3.6
1.3.4 1.3.5 1.3.6 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 1.5.2 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.6.1 1.6.2 1.6.3 1.7.0 1.7.1 1.7.2 1.8.0 1.8.1 2.0.0 All 36 releases
getresponse / includes / eoi-error-handler.php

eoi-error-handler.php in GetResponse Forms by Optin Cat 1.3.6, at includes/eoi-error-handler.php

47 lines 970 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class EasyOptInsErrorHandler {
4 public $errors = array();
5 public $output = array();
6
7 public function capture_start() {
8 ob_start();
9
10 set_error_handler( array( $this, 'handle_error' ), E_USER_ERROR );
11
12 add_filter( 'wp_die_handler', array( $this, 'handle_die' ) );
13 add_filter( 'wp_die_ajax_handler', array( $this, 'handle_die' ) );
14 }
15
16 public function capture_end() {
17 ob_end_clean();
18
19 restore_error_handler();
20
21 remove_filter( 'wp_die_handler', array( $this, 'handle_die' ) );
22 remove_filter( 'wp_die_ajax_handler', array( $this, 'handle_die' ) );
23 }
24
25 public function handle_error( $err_no, $err_str ) {
26 $this->output[] = ob_get_clean();
27 ob_start();
28
29 $this->errors[] = $err_str;
30 }
31
32 public function handle_die() {
33 $output = ob_get_clean();
34 ob_start();
35
36 $this->output[] = $output;
37
38 return array( $this, 'handle_die_callback' );
39 }
40
41 public function handle_die_callback( $message ) {
42 $this->errors[] = $message;
43
44 return true;
45 }
46 }
47