Commit Graph

115 Commits

Author SHA1 Message Date
MarkBaker b6a73aec56 Improvements to the design of the XML Security Scanner 2018-11-25 18:39:05 +01:00
MarkBaker f5d1f03e94 Update Changelog 2018-11-20 20:57:38 +01:00
MarkBaker 7f46932b2f Update Changelog 2018-11-20 20:51:42 +01:00
Guillaume RODRIGUEZ 3bea6f516b
Fix index overflow on data values array
Fix index overflow on data values array for multi level detection.

Fixes #747
Fixes #748
2018-11-11 21:43:44 +11:00
Adrien Crivelli e4ffeb4f0f
Move feature in correct section 2018-11-11 21:39:19 +11:00
Albert Scherman 31e25ad14b
Support page margin in mPDF
Fixes #750
Fixes #751
2018-11-11 21:30:00 +11:00
Danielle McLean 6703624223
Write generated HTML into Mpdf in chunks, rather than as one gigantic string
Due to a limitation in Mpdf, the HTML string passed to its WriteHTML method
must not exceed a particular length. PhpSpreadsheet produces one HTML string
containing all spreadsheet data when writing to HTML, which can easily exceed
Mpdf's size limit. Thus, it was impossible to write large spreadsheets to PDF
using the Mpdf writer - this change fixes that issue.

Fixes #637
Fixes #706
2018-11-03 18:37:47 +11:00
Milan Davídek 3be06a5e87
Support overriding `DefaultValueBinder::dataTypeForValue()`
This allow to avoid overriding `DefaultValueBinder::bindValue()`

Fixes #735
2018-11-03 17:25:43 +11:00
Guillaume RODRIGUEZ fdc224af7c
Fix print area parser for XLSX reader
XLSX workbook references may not contains quotes in print area

Fixes #733
Fixes #734
2018-10-28 14:37:05 +11:00
Laurent 79d86ef5cc
Csv reader avoid notice when the file is empty
Fixes #337
2018-10-28 14:16:53 +11:00
Jon Dufresne 5b3870c508
Prefer https:// URLs when available in docs & comments
Fixes #737
2018-10-28 13:55:00 +11:00
marcusblevin 98d10475f2
SUMIFS sum values only once
Values were summed multiple times if it matched several conditions
whereas it should only be summed once.

Fixes #704
Fixes #710
2018-10-28 13:09:08 +11:00
Sreten Ilić ed6a3a0148
Support numeric condition in SUMIF, SUMIFS, AVERAGEIF, COUNTIF, MAXIF and MINIF
Fixes #683
Fixes #701
2018-10-28 12:47:53 +11:00
Adrien Crivelli 2dfd06c598
1.5.0 2018-10-21 21:04:54 +11:00
Paul Barton 813855b2b2
Fix CSV delimiter detection on line breaks
The CSV Reader can now correctly ignore line breaks inside
enclosures which allows it to determine the delimiter
correctly.

Fixes #716
Fixes #717
2018-10-21 18:23:55 +11:00
Adrien Crivelli 09eb05f367
OFFSET should allow omitted height and width
Commit 8dddf56 inadvertently removed the ability to omit the width
and height arguments to the OFFSET function. And #REF! is returned
because the function is validating that the new $pCell argument
is present. It is present, but it has been passed in the $height position.

We fixed this by always passing $pCell at the last position and filling
missing arguments with NULL values.

Fixes #561
Fixes #565
2018-10-21 17:45:02 +11:00
Biser Antonov 2c981e47a1
Added the DAYS() function
https://support.office.com/en-us/article/days-function-57740535-d549-4395-8728-0f07bff0b9df
2018-10-21 15:26:46 +11:00
Adrien Crivelli f25d8b72c0
Move changelog entry under unreleased 2018-10-07 18:50:31 +11:00
bayzhanov 08b4456641
Xls file threw exception during open by Xls reader
Ignore some exception in property, if stream is empty

Fixes #402
Fixes #659
2018-10-07 18:49:01 +11:00
Scorty ae9dd13aa0 Skip non numeric value in SUMIF
MS Excel skip non numeric values also. PhpSpreadsheet used to fail on string value with: Warning: A non-numeric value encountered.

Fixes  #618
2018-10-07 17:24:23 +11:00
Timur 50a9bc83ab Sheet title can contain exclamation mark (in formulas)
When extracting sheet title from string reference (like `"Work!sheet1!A1"`), PHP function `explode()` divide this string into three parts: `['Work', 'sheet1', 'A1']`. And then these wrong values are used in formulas, ranges, etc.

This change fix that problem by using special function `Worksheet::extractSheetTitle()`. This function also has been changed to make sure that worksheet title can contain "!" character. So, that function search last position of "!" in reference string and divide it to 2 parts correctly: `['Work!sheet1', 'A1']`.

Fixes #325
Fixes #662
2018-10-03 12:52:51 +09:00
Adrien Crivelli 57404f4374
1.4.1 2018-09-30 12:57:24 +09:00
Derek Bonner 01501b6ff2 Remove locale from format string to prevent formatting error (#644)
When a formatting string has a locale in it an error can occur when outputting. For example when the format string with a locale such as `[$-1010409]#,##0.00;-#,##0.00` appears, a value of 9.98 comes back as $9.98. This is because at https://github.com/PHPOffice/PhpSpreadsheet/blob/1.4.0/src/PhpSpreadsheet/Style/NumberFormat.php#L711 the numberFormat regex will match to the zeros inside the locale ([$-1010409]). Attempts to adjust the numberFormat regex caused regressions in other tests. Adding another step to filter out the locale caused no regression.
2018-09-28 21:28:40 +09:00
AegirLeet bebfb1e41a Fix warning when reading xlsx without styles
Fixes https://github.com/PHPOffice/PHPExcel/issues/1134
Fixes #631
2018-08-19 15:43:54 +09:00
Dalibor Karlović 5e090d1af0
Allow iterators to go out of bounds with prev()
Iterators prev() behavior is now consistent with next(), meaning
that it can go out of bounds and it must be validated with valid()
before using it.

Fixes #587
Fixes #627
2018-08-19 14:02:17 +09:00
Adrien Crivelli 125f462a71
1.4.0 2018-08-06 11:58:06 +09:00
Daniel 46eabbad60
Rowspans/colspans were incorrect when adding worksheet using loadIntoExisting
Rowspans/colspans are now respected for each HTML document added to an existing
spreadsheet as a new worksheet. The protected $rowspan class property should
be emptied on each call to `loadIntoExisting`.

Fixes #619
Fixes #620
2018-08-05 13:41:06 +09:00
Andrew Siegman adf95bcc0e
Migration tool keep variables containing $PHPExcel untouched
Fixes #598
Fixes #609
2018-08-05 13:27:55 +09:00
Walter Nasich 048947e390
Avoid memory exhaustion when cloning worksheet with a drawing
When cloning `BaseDrawing`, its worksheet will be set as null and thus be
orphaned. But when cloning the worksheet, it will re-assign itself as the
new worksheet for the BaseDrawing.

That way we avoid recursive cloning of a Worksheet that would clone a
BaseDrawing that would clone a Worksheet etc.

Fixes #437
Fixes #613
2018-08-05 13:21:01 +09:00
Mark Baker 1b96c95a44
Add new Complex Number Functions introduced in MS Excel 2013 (#601)
* - Refactored Complex Engineering Functions to use external complex number library
- Added calculation engine support for the new complex number functions that were added in MS Excel 2013
    - IMCOSH()  Returns the hyperbolic cosine of a complex number
    - IMCOT()   Returns the cotangent of a complex number
    - IMCSC()   Returns the cosecant of a complex number
    - IMCSCH()  Returns the hyperbolic cosecant of a complex number
    - IMSEC()   Returns the secant of a complex number
    - IMSECH()  Returns the hyperbolic secant of a complex number
    - IMSINH()  Returns the hyperbolic sine of a complex number
    - IMTAN()   Returns the tangent of a complex number
* Simplified the parseComplex() method in the PhpOffice\PhpSpreadsheet\Calculation\Engineering class, using Complex\Complex; and docblock flagged as deprecated
2018-07-25 14:38:44 +01:00
Mark Baker 67cdee6033
Add new Bitwise Functions introduced in MS Excel 2013 (#603)
* - Added calculation engine support for the new bitwise functions that were added in MS Excel 2013
  - BITAND()     Returns a Bitwise 'And' of two numbers
  - BITOR()      Returns a Bitwise 'Or' of two number
  - BITXOR()     Returns a Bitwise 'Exclusive Or' of two numbers
  - BITLSHIFT()  Returns a number shifted left by a specified number of bits
  - BITRSHIFT()  Returns a number shifted right by a specified number of bits
2018-07-22 22:16:34 +01:00
Mark Baker 9b44cf3418
Add further new Functions introduced in MS Excel 2013 and 2016 (#608)
- Fix ISFORMULA() function to work with a cell reference to another worksheet
 - Added calculation engine support for the new functions that were added in MS Excel 2013 and MS Excel 2016
   - Text Functions
     - CONCAT()     Synonym for CONCATENATE()
     - NUMBERVALUE()  Converts text to a number, in a locale-independent way
     - UNICHAR()    Synonym for CHAR() in PHPSpreadsheet, which has always used UTF-8 internally
     - UNIORD()     Synonym for ORD() in PHPSpreadsheet, which has always used UTF-8 internally
     - TEXTJOIN()   Joins together two or more text strings, separated by a delimiter
   - Logical Functions
     - XOR()        Returns a logical Exclusive Or of all arguments
   - Date/Time Functions
     - ISOWEEKNUM()  Returns the ISO 8601 week number of the year for a given date
   - Lookup and Reference Functions
     - FORMULATEXT()  Returns a formula as a string
   - Engineering Functions
     - ERF.PRECISE()   Returns the error function integrated between 0 and a supplied limit
     - ERFC.PRECISE()  Synonym for ERFC
   - Math and Trig Functions
     - SEC()          Returns the secant of an angle
     - SECH()         Returns the hyperbolic secant of an angle
     - CSC()          Returns the cosecant of an angle
     - CSCH()         Returns the hyperbolic cosecant of an angle
     - COT()          Returns the cotangent of an angle
     - COTH()         Returns the hyperbolic cotangent of an angle
     - ACOT()         Returns the cotangent of an angle
     - ACOTH()        Returns the hyperbolic cotangent of an angle
  - Financial Functions
    - PDURATION()    Calculates the number of periods required for an investment to reach a specified value
    - RRI()          Calculates the interest rate required for an investment to grow to a specified future value
2018-07-22 19:17:04 +01:00
yuzhakov 17d4a54666
Read and write hyperlink for drawing image
Fixes #490
2018-07-15 13:00:30 +09:00
Einar Lielmanis b05d07a365 Chained operations on cell ranges involving borders are now possible
Fixes #428
Fixes #578
2018-07-15 12:19:54 +09:00
Rolands Usāns eb31899225 Function EXACT(arg1, arg2) support (#595) 2018-07-15 11:56:25 +09:00
Andrew Siegman 043327bb7d
Exclude the vendor folder in migration
Fixes #481
Fixes #586
2018-07-08 13:35:40 +09:00
Adrien Crivelli 9fdcaabe3c
Could not open CSV file containing HTML fragment
We now always trust the file extension to avoid false positive of mime
detection for most simple cases. But we still try to guess the mime type
if the file extension does not match or is missing.

Fixes #564
2018-06-25 11:12:27 +09:00
Bill Blume edb68ce05c
Support workbook view attributes for Xlsx format
Editing a Xlsx document using PhpSpreadsheet should preserve the workbook
view attributes of that document. For example, if the worksheet tabs are
hidden in the original document, they should remain hidden after updating.

Fixes #523
Fixes #525
2018-06-24 20:15:38 +09:00
Derek Bonner 7a4cbd4fd5 Cell formats with escaped spaces were causing incorrect date formatting
Fix issue where escaped spaces in cell format would cause incorrect
date format leading to incorrect time conversions

Fixes #557
Closes #558
2018-06-24 19:35:45 +09:00
Mewes Kochheim a6bb491539
Fixed method call (setRevisionPassword -> setRevisionsPassword)
Fixes #553
2018-06-18 13:47:58 +09:00
Adrien Crivelli aa5b0d0236
1.3.1 2018-06-12 22:40:21 +09:00
Adrien Crivelli 371c800e3f
Ranges across Z and AA columns incorrectly threw an exception
Fixes #545
2018-06-11 22:54:11 +09:00
Adrien Crivelli 2eb342c13d
1.3.0 2018-06-10 15:44:19 +09:00
Bill Blume 4c09d4f668
Properly set selected cells for frozen panes
Properly set the selected cells for worksheets with frozen panes when
writing Xlsx documents. Beforehand, the saved Xlsx documents were
generating corruption warnings when opened in Excel.

Fixes #532
Closes #535
2018-06-10 14:56:53 +09:00
Bill Blume e3fb160f5f
Fixed parsing of conditionals in COUNTIF functions
Conditional operators in the selection parameter of COUNTIF
functions were not being parsed properly, causing evaluations
of formulae with such functions to sometimes fail.

Fixes #526
Closes #528
2018-06-10 14:25:33 +09:00
Robin D'Arcy ed2185417e
Throw exception for invalid range to prevent infinite loop
Fixes #519
Closes #521
2018-06-10 13:34:10 +09:00
Adrien Crivelli 4bc3ee3830
Update Changelog for previous commit 2018-06-10 13:06:57 +09:00
Dominik b509b672e0
Xlsx reader do not read rows and columns filtered out in readFilter at all
Set rows and columns dimensions for only cells rows and columns
allowed by readfilter

Fixes #370
Closes #421
2018-05-26 13:30:21 +09:00
Dominik 7e9f43bf5b
Fix Xlsx loaded an extra empty comment for each real comment
Fixes #375
Closes #420
2018-05-26 11:19:12 +09:00
Robin D'Arcy c723833d6f Allow CSV escape character to be set
Fixes #492
Closes #510
2018-05-23 10:31:41 +09:00