Skip to content

[Bug Report]: diff tool error while processing space between general and multibytes characters #3170

@johnroyer

Description

@johnroyer

Describe the Bug

Diff tool can not work correctly if add/delete space in general character and multibytes characters.

2022-01-17_160517

Steps to Reproduce

  1. Create a page
  2. copy and paste this string: test測試
  3. Save page. (revision 1)
  4. Edit page
  5. Add a space between the words. New string will be: test 測試
  6. Save page. (revision 2)
  7. Click Revision of page details.
  8. Click Changes on the latest revision.
  9. Diff tool show some un-expect digits: 2022-01-17_162254

Expected Behaviour

Diff tool should show spaces only.

Screenshots or Additional Context

Error WILL occur if and if the add / delete space between general character and multibyte character.


The error will NOT occur on this conditions:

  • New space between general characters. Example: unittest to unit test.
  • New space between multibyte characters. Example: 你好 to 你 好.

Exact BookStack Version

21.12

PHP Version

7.4.27

Hosting Environment

  • Ubuntu 20.04.3 LTS
  • Nginx 1.18.0 (reverse proxy)
  • PHP-fpm 7.4.27

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions