PluginProbe
TablePress – Tables in WordPress made easy / 3.0
TablePress – Tables in WordPress made easy v3.0
3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.12 1.14 1.9.2 2.0.4 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.4.3 2.4.4 All 44 releases
← All changes | classes/class-import-phpspreadsheet.php +6 -6 2.4.23.0 View file →
@@ -176,9 +176,9 @@
176 176
177 177 try {
178 178 // Treat all cell values as strings, except for formulas (due to recognition of quoted/escaped formulas like `'=A2`).
179 179 \TablePress\PhpOffice\PhpSpreadsheet\Cell\Cell::setValueBinder( new \TablePress\PhpOffice\PhpSpreadsheet\Cell\StringValueBinder() );
180 - \TablePress\PhpOffice\PhpSpreadsheet\Cell\Cell::getValueBinder()->setFormulaConversion( false ); // @phpstan-ignore-line
180 + \TablePress\PhpOffice\PhpSpreadsheet\Cell\Cell::getValueBinder()->setFormulaConversion( false ); // @phpstan-ignore method.notFound
181 181
182 182 /*
183 183 * Try to detect a reader from the file extension and MIME type.
184 184 * Fall back to CSV if no reader could be determined.
@@ -207,10 +207,10 @@
207 207 $class_type = explode( '\\', $class_name );
208 208 $detected_format = strtolower( array_pop( $class_type ) );
209 209
210 210 if ( 'csv' === $detected_format ) {
211 - $reader->setInputEncoding( \TablePress\PhpOffice\PhpSpreadsheet\Reader\Csv::GUESS_ENCODING ); // @phpstan-ignore-line
212 - // @phpstan-ignore-next-line
211 + $reader->setInputEncoding( \TablePress\PhpOffice\PhpSpreadsheet\Reader\Csv::GUESS_ENCODING ); // @phpstan-ignore method.notFound
212 + // @phpstan-ignore method.notFound
213 213 $reader->setEscapeCharacter( ( PHP_VERSION_ID < 70400 ) ? "\x0" : '' ); // Disable the proprietary escape mechanism of PHP's fgetcsv() in PHP >= 7.4.
214 214 }
215 215
216 216 $reader->setIncludeCharts( false );
@@ -222,9 +222,9 @@
222 222 }
223 223
224 224 // For formats where it's supported, import only the first sheet.
225 225 if ( in_array( $detected_format, array( 'csv', 'html', 'slk' ), true ) ) {
226 - $reader->setSheetIndex( 0 ); // @phpstan-ignore-line
226 + $reader->setSheetIndex( 0 ); // @phpstan-ignore method.notFound
227 227 }
228 228
229 229 $spreadsheet = $reader->load( $file->location );
230 230 $worksheet = $spreadsheet->getActiveSheet();
@@ -285,13 +285,13 @@
285 285 }
286 286 $cell_data = \TablePress\PhpOffice\PhpSpreadsheet\Style\NumberFormat::toFormattedString(
287 287 $cell_data,
288 288 $format,
289 - array( $this, 'format_color' )
289 + array( $this, 'format_color' ),
290 290 );
291 291
292 292 if ( strlen( $cell_data ) > 1 && '=' === $cell_data[0] ) {
293 - if ( $style->getQuotePrefix() ) {
293 + if ( 'xlsx' === $detected_format && $style->getQuotePrefix() ) {
294 294 // Prepend a ' to quoted/escaped formulas (so that they are shown as text). This is currently not supported (at least) for the XLS format.
295 295 $cell_data = "'{$cell_data}";
296 296 } else {
297 297 // Bail early, to not add inline HTML styling around formulas, as they won't work anymore then.