Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check size in bytes as opposed to string size #589

Open
wants to merge 46 commits into
base: master
Choose a base branch
from

Conversation

aardvarkk
Copy link

size returns length in characters, but doesn't factor in multibyte Unicode characters.
By switching to bytesize, we check the relevant measure of how many bytes the worksheet name is.

Fixes #588.

straydogstudio and others added 30 commits September 8, 2019 19:25
https://guides.rubygems.org/make-your-own-gem/
The convention is to have one Ruby file with the same name as your gem, since that gets loaded when require is run.
nokogiri <1.10.4 and rubyzip < 1.3.0 had CVEs and/or regressions,
and whilst we're here, signal that it's okay to use Ruby 2.3 syntax
and methods and later.
Add caxlsx.rb to make auto require work
This PR aims to fix several issues with Relationship cache:

1) It's not threadsafe, so I propose to use a TLS variable for this.
2) Memory obtained by cache remains non-freed before the next run of `serialize`. I think it should be freed immediately.
3) Memory should be freed in `ensure` block to prevent memory bloating in case of exception.

*There are only two hard things in Computer Science: cache invalidation and naming things.*
Also cacle only ids, not entire instances.
Bump dependencies for nokogiri, ruby, and rubyzip.
…p_cache

Fix Relationship.instances cache
Fixnum is removed by 12d6433, but this typo was remained.
@noniq
Copy link
Collaborator

noniq commented Dec 15, 2019

@aardvarkk Would you like to recreate this PR in https://github.com/caxlsx/caxlsx/ ? I think we should get this merged.

noniq and others added 2 commits December 15, 2019 19:27
- `size` returns length in characters, but doesn't factor in multibyte Unicode characters.
By switching to `bytesize`, we check the relevant measure of how many bytes the worksheet name is.
- Fixes randym#588
- Copy of PR against original axlsx
(randym#589)
@aardvarkk
Copy link
Author

@noniq Done! Please see caxlsx/caxlsx#35

noniq pushed a commit to caxlsx/caxlsx that referenced this pull request Dec 17, 2019
- `size` returns length in characters, but doesn't factor in multibyte Unicode characters.
By switching to `bytesize`, we check the relevant measure of how many bytes the worksheet name is.
- Fixes randym/axlsx#588
- Copy of PR against original axlsx
(randym/axlsx#589)
@noniq noniq assigned noniq and unassigned noniq Dec 17, 2019
@noniq noniq added the Done in caxlsx This has already been solved in the caxlsx fork. label Dec 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Done in caxlsx This has already been solved in the caxlsx fork.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Corrupted files can be generated when worksheet names of a certain length contain unicode