mirror of
https://github.com/opf/openproject.git
synced 2026-06-13 19:20:00 +00:00
adf9cc1669
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.