Jump to content
  • [Beta 10] Word Expansion Matching


    Description of the Bug:

    The Word Expansion feature in Invision Board Community v5 Beta 10 exhibits incorrect matching behavior when multiple word expansions share similar prefixes. The issue arises when word expansions such as:

    • PCI
    • PCIe
    • PCI-DSS
    • PCI-X

    are added to the Word Expansion list. The system does not differentiate between these variations correctly and applies expansions incorrectly when terms with similar prefixes are used in posts or comments.

    Steps to Reproduce:

    1. Navigate to the Admin Control Panel (ACP).
    2. Go to System > Settings > Posting & Editor > Word Expansions.
    3. Add the following word expansions:
      1. PCI
      2. PCIe
      3. PCI-DSS
      4. PCI-X
    4. Save the changes.
    5. Create a new forum post or comment with the text: "This server is PCI-DSS compliant and uses a PCIe SSD, a PCI network card and a PCI-X raid card."
    6. Observe the applied word expansions in the post.

    Expected Behavior:

    Each word expansion should apply only to the exact matching term in the text. For example:

    • PCI should expand only when the standalone term "PCI" is used.
    • PCIe should expand only when the term "PCIe" is used.
    • PCI-DSS should expand only when the term "PCI-DSS" is used.

    image.png.465c798f639540d71883ef7178688a27.png

    • PCI-X should expand only when the term "PCI-X" is used.

    Actual Behavior:

    The word expansion logic applies expansions inconsistently. For example:

    • "PCIe" triggers the "PCIe" expansion.
    • "PCI-DSS" triggers "PCI" expansions.
    • "PCI-X" triggers the "PCI" expansion.
    • "PCI" triggers the "PCI" expansion.

    This incorrect matching behavior causes confusion and unintended text replacements.

    Impact:

    Users experience incorrect text replacements in their forum posts. This can lead to confusion, especially in technical forums where precise terminology is crucial. It diminishes the usability of the Word Expansion feature.

    Suggested Fix:

    Update the Word Expansion matching algorithm to ensure it matches whole words or specific phrases accurately. Implement a stricter matching mechanism that differentiates between exact terms and terms with similar prefixes.

    Environment:

    • Platform: Linux (Ubuntu 24.04)
    • Web Server: nGinX
    • PHP Version: 8.2
    • Database: MySQL 8.0
    • Browser: Microsoft Edge

    Attachments:

    image.png.da1b5f4003084b87d24aeed099e99914.png


    image.thumb.png.e533ed8a95d30a53d310bdd2b7020472.png

    image.thumb.png.74804cf822923d28eab43e4f4e19bd63.png

    Bug Report Update

    Title: [Beta 10] Word Expansion Matching (Additional Findings)

    Description:
    Following my initial bug report regarding the Word Expansion feature in IC v5 Beta 10, I have discovered that deleting and re-adding the affected word expansion "PCI" temporarily resolves the issue. Once re-added, the system correctly matches each term, such as "PCI", "PCIe", "PCI-DSS", and "PCI-X", without triggering incorrect expansions.

    This behavior suggests a potential issue with how word expansions are initially cached or indexed.

    Steps to Verify Fix:

    1. Delete the "PCI" expansion from the Word Expansion list.
    2. Re-add "PCI" with the same settings.
    3. Retest by editing the forum post created with the terms specified.
    4. Observe that the system now matches each term correctly.

    Impact:
    While this workaround solves the issue temporarily, it may confuse users who are unaware of the need to manually reset word expansions.

    Suggested Fix:
    I have no idea... Didn't look 🙂 

    Reported by: Jessica
    Date: January 12, 2025


    User Feedback

    Recommended Comments

    Marc

    Posted

    When you say "Re-add", were they added on an old release? If so, it may well be the bug is simply no longer present. Are you able to reproduct it since being on beta 10 with only new word expansions? Also, are you ensure you are using "exact" for the match?

    Code Name Jessica

    Posted

    No, when I said Re-add, I meant that in version 5b10, I would delete the prefix word in this case 'PCI' then re-add 'PCI' back into the word list. and it would work correctly.

    So, as I explained in the first post, I added in this order:

    1. PCI
    2. PCIe
    3. PCI-DSS
    4. PCI-X

    and it showed PCI over-riding each of them, then I deleted PCI and re-added it to the list. Everything worked correctly.

    So, for another example, I thought I would try to do it this way:

    1. TEST-TOPIC
    2. TEST-TOPIC-WORD

    It's the Hyphen, that is what is screwing it up I tested with TEST, TESTS, TESTED, and TESTING and it works as it should, but if there is a hyphen like this... TEST-TOPIC-WORD, should have the title="THIS IS A TEST-TOPIC-WORD TEST" but it has "THIS IS A TEST-TOPIC TEST" (also ignore the data-original-title="", it also has title="", just didn't capture that part of the screen).

    image.png.9f50af520e080e5e3365e562a6844490.png

    image.thumb.png.665688ead5c7b19ec931ab976f01a481.png


×
×
  • Create New...