| @@ -27,9 +27,9 @@ | ||
| 27 | 27 | * @since 2.0.0 |
| 28 | 28 | */ |
| 29 | 29 | public function __construct() { |
| 30 | 30 | // Load PHPSpreadsheet via its autoloading mechanism. |
| 31 | - TablePress::load_file( 'autoload.php', 'libraries/vendor' ); | |
| 31 | + TablePress::load_file( 'autoload.php', 'libraries' ); | |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * Evaluates formulas in the passed table. |
| @@ -113,9 +113,9 @@ | ||
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | // Sanitize the output of the evaluated formula. |
| 116 | 116 | $cell_content = wp_kses_post( $cell_content ); // Equals wp_filter_post_kses(), but without the unnecessary slashes handling. |
| 117 | - } catch ( \Throwable $exception ) { | |
| 117 | + } catch ( \TablePress\PhpOffice\PhpSpreadsheet\Calculation\Exception $exception ) { | |
| 118 | 118 | $message = str_replace( 'Worksheet!', '', $exception->getMessage() ); |
| 119 | 119 | $cell_content = "!ERROR! {$message}"; |
| 120 | 120 | } |
| 121 | 121 | } |
| @@ -126,9 +126,9 @@ | ||
| 126 | 126 | |
| 127 | 127 | // Save PHP memory. |
| 128 | 128 | $spreadsheet->disconnectWorksheets(); |
| 129 | 129 | unset( $cell_collection, $worksheet, $spreadsheet ); |
| 130 | - } catch ( \Throwable $exception ) { | |
| 130 | + } catch ( \TablePress\PhpOffice\PhpSpreadsheet\Calculation\Exception $exception ) { | |
| 131 | 131 | $message = str_replace( 'Worksheet!', '', $exception->getMessage() ); |
| 132 | 132 | $table_data = array( array( "!ERROR! {$message}" ) ); |
| 133 | 133 | } |
| 134 | 134 | |