caxlsx 3.4.0 → 3.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -1
- data/README.md +3 -2
- data/lib/axlsx/version.rb +1 -1
- data/lib/axlsx/workbook/worksheet/cell.rb +10 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bc64f23079fdbb6084190c180942bdf850ef2a0f0e6e75e68b3c9f63bcb6a2b
|
4
|
+
data.tar.gz: 389bd6a8434de5942a54d47c2fafd4b407fead102ef0186d6f180879689c9a96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f0de7a6035a2179287b06eef2d942b53e4c5ba18f8d26dd5df7cb48ae32ecb320bce6fa8f778683f57de10a8f7a3b4e1c2123c8f25c3406360573bebf54ee25
|
7
|
+
data.tar.gz: 5c85f6027cf1e286b53885d9d2cd0226eaff9079d1bc6933a0bb7659a85965c0f791e0d3ccf22ca745d44b4927b981c4abffe8734aa43043c98ffa5363c4698c
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
CHANGELOG
|
2
2
|
---------
|
3
|
-
- **Unreleased
|
3
|
+
- **Unreleased**: 3.4.1
|
4
|
+
- [PR #209](https://github.com/caxlsx/caxlsx/pull/209) - Revert characters other than `=` being considered as formulas.
|
4
5
|
|
5
6
|
- **April.12.23**: 3.4.0
|
6
7
|
- [PR #186](https://github.com/caxlsx/caxlsx/pull/186) - Add `escape_formulas` to global, workbook, worksheet, row and cell levels, and standardize behavior.
|
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# Caxlsx (Community Continued Version)
|
2
|
-
[![
|
2
|
+
[![Test](https://github.com/caxlsx/caxlsx/actions/workflows/test.yml/badge.svg)](https://github.com/caxlsx/caxlsx/actions/workflows/test.yml)
|
3
|
+
[![RuboCop](https://github.com/caxlsx/caxlsx/actions/workflows/rubocop.yml/badge.svg)](https://github.com/caxlsx/caxlsx/actions/workflows/rubocop.yml)
|
3
4
|
[![Gem Version](https://badge.fury.io/rb/caxlsx.svg)](https://badge.fury.io/rb/caxlsx)
|
4
5
|
![downloads](https://img.shields.io/gem/dt/caxlsx?label=downloads)
|
5
6
|
|
@@ -130,7 +131,7 @@ Axlsx.escape_formulas = true
|
|
130
131
|
Then, set the following on each cell you'd like to add a formula:
|
131
132
|
|
132
133
|
```ruby
|
133
|
-
cell.escape_formulas =
|
134
|
+
cell.escape_formulas = false
|
134
135
|
```
|
135
136
|
|
136
137
|
Refer to examples/escape_formula.md for how to set `escape_formulas` on the workbook, worksheet, row and/or cell level.
|
data/lib/axlsx/version.rb
CHANGED
@@ -72,7 +72,13 @@ module Axlsx
|
|
72
72
|
|
73
73
|
# Leading characters that indicate a formula.
|
74
74
|
# See: https://owasp.org/www-community/attacks/CSV_Injection
|
75
|
-
FORMULA_PREFIXES = ['
|
75
|
+
FORMULA_PREFIXES = ['='.freeze].freeze
|
76
|
+
|
77
|
+
# Leading characters that indicate an array formula.
|
78
|
+
ARRAY_FORMULA_PREFIXES = ['{='.freeze].freeze
|
79
|
+
|
80
|
+
# Trailing character that indicates an array formula.
|
81
|
+
ARRAY_FORMULA_SUFFIX = '}'.freeze
|
76
82
|
|
77
83
|
# The index of the cellXfs item to be applied to this cell.
|
78
84
|
# @return [Integer]
|
@@ -393,7 +399,9 @@ module Axlsx
|
|
393
399
|
def is_array_formula?
|
394
400
|
return false if escape_formulas
|
395
401
|
|
396
|
-
type == :string &&
|
402
|
+
type == :string &&
|
403
|
+
@value.to_s.start_with?(*ARRAY_FORMULA_PREFIXES) &&
|
404
|
+
@value.to_s.end_with?(ARRAY_FORMULA_SUFFIX)
|
397
405
|
end
|
398
406
|
|
399
407
|
# returns the absolute or relative string style reference for
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caxlsx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Randy Morgan
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-04-
|
12
|
+
date: 2023-04-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|