Skip to content

vcard: Fix whitespace handling in line cont's - #9637

Merged
alecpl merged 3 commits into
roundcube:masterfrom
respiranto:fix-vcard-multiline-whitespace
Sep 18, 2024
Merged

vcard: Fix whitespace handling in line cont's#9637
alecpl merged 3 commits into
roundcube:masterfrom
respiranto:fix-vcard-multiline-whitespace

Conversation

@respiranto

Copy link
Copy Markdown
Contributor

Previously, multiple whitespace characters at the start of a continuation line would all be dropped, instead of only the first one.

Also,

  • restrict line continuation characters to SPACE and TAB.

Note that, like before, this identifies the CR (\r) character with the empty string, and thereby notably does not require a CRLF (\r\n) sequence (which is mandated by RFCs 2426, 2425) for line termination (i.e., \n suffices).

Fixes: Bug 1 of issue #9593.

Previously, multiple whitespace characters at the start of a
continuation line would all be dropped, instead of only the first one.

Also,
 - restrict line continuation characters to SPACE and TAB.

Note that, like before, this identifies the CR (`\r`) character with the
empty string, and thereby notably does not require a CRLF (`\r\n`)
sequence (which is mandated by RFCs 2426, 2425) for line termination
(i.e., `\n` suffices).

Fixes: Bug 1 of issue roundcube#9593.
@pabzm

pabzm commented Sep 15, 2024

Copy link
Copy Markdown
Member

Thank you very much! The failing tests are unrelated to your changes, I guess. I'll try to run them again later, since it looks like a temporary problem.

If you feel up to it I'd really celebrate if you would add a unit-test to check the now correct behaviour!

@pabzm

pabzm commented Sep 16, 2024

Copy link
Copy Markdown
Member

@alecpl The CI fails because the TLS-cert of git.kolab.org expired 2 days ago. Is there maybe anything you can do about that?

@respiranto

respiranto commented Sep 16, 2024

Copy link
Copy Markdown
Contributor Author

Test added.

Running the tests locally, I got the following, seemingly unrelated failure:

1) Roundcube\Tests\Framework\ImapTest::test_sort_folder_list
Failed asserting that two arrays are identical.
--- Expected
+++ Actual
@@ @@
     0 => 'INBOX',
     1 => 'INBOX.Drafts',
     2 => 'INBOX.Sent',
-    3 => 'INBOX.sub',
-    4 => 'INBOX.Trash',
+    3 => 'INBOX.Trash',
+    4 => 'INBOX.sub',
     5 => 'Drafts',
     6 => 'Sent',
     7 => 'INBOX.Junk',

/home/u/roundcubemail/tests/Framework/ImapTest.php:148

@pabzm

pabzm commented Sep 17, 2024

Copy link
Copy Markdown
Member

That sorting failure is unrelated, don't worry about it!

@pabzm

pabzm commented Sep 17, 2024

Copy link
Copy Markdown
Member

Have a look at the Coding Style check errors, please.

@respiranto

Copy link
Copy Markdown
Contributor Author

Fixed coding style errors.

@pabzm
pabzm requested review from alecpl and pabzm September 18, 2024 11:01

@pabzm pabzm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thank you very much for your contribution!

@alecpl
alecpl merged commit 6159ebe into roundcube:master Sep 18, 2024
alecpl pushed a commit that referenced this pull request Sep 18, 2024
* vcard: Fix whitespace handling in line cont's

Previously, multiple whitespace characters at the start of a
continuation line would all be dropped, instead of only the first one.

Also,
 - restrict line continuation characters to SPACE and TAB.

Note that, like before, this identifies the CR (`\r`) character with the
empty string, and thereby notably does not require a CRLF (`\r\n`)
sequence (which is mandated by RFCs 2426, 2425) for line termination
(i.e., `\n` suffices).

Fixes: Bug 1 of issue #9593.

* vcard: Add test for #9593/1

* Fix coding style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants