Files
openproject/spec/workers/attachments
Christophe Bliard adf9cc1669 [68047] Prevent FrozenError in Attachments::ExtractFulltextJob
There is a bug in the plaintext gem in its `Plaintext::Resolve#text`: it
executes external commands to extract text from files. This can return
`nil` when it has no output, and it's then converted to a string using
`to_s`.

`nil.to_s` returns a frozen empty string since ruby 2.7. When it then
calls `text.gsub!(/\s+/m, ' ')` later in the `#text` method, the
`FrozenError` occurs.

The fix is to patch the `Plaintext::Resolver#text` method to create a
mutable copy of the text if it's frozen.
2025-10-08 16:21:58 +02:00
..