Skip to content

AutoLinker Phone overly aggressive #27141

@nmagedman

Description

@nmagedman

Description:

The AutoLinker Phone code matches any plus sign (+) followed by one or more digits, regardless whether it is a valid phone number.

Steps to reproduce:

  1. Go to /admin/Settings/Message > AutoLinker and ensure that Enabled and AutoLinker Phone are both enabled.
  2. In a chat, enter the text 1+1=2

Expected behavior:

The chat message should not contain any hyperlinks

Actual behavior:

The +1 is hyperlinked to tel:1 even though it is not a valid phone number.

Screen Shot 2022-10-27 at 11 15 25

Here's another sample:
AutoLinker Number

Server Setup Information:

  • Version of Rocket.Chat Server: 5.1.2
  • Operating System: Linux
  • Deployment Method: tar
  • Number of Running Instances: 5
  • DB Replicaset Oplog:
  • NodeJS Version: v14.19.3
  • MongoDB Version: 4.2.15 / wiredTiger (oplog Enabled)

Client Setup Information

  • Desktop App or Browser Version: Chrome 106.0.5249.119
  • Operating System: MacOS

Additional context

  • This problem has actually been around for a long time. It appears to have started over a year ago when we upgraded from RC 3.12.1 to 3.16.3

    Most recent correct behavior

    > db.rocketchat_message.find({msg:/\+\d/, md:{$exists:false}}).sort({$natural:-1}).pretty()
    

    Message includes 28.5/(84.5+28.5) which was left as-is. If I type this same text now, it links the +28 to tel:28

    First sighting of the problem

    > db.rocketchat_message.find({msg:/\+\d/, ts:{$gt:ISODate("2021-07-31T22:48:53.089Z")}}).pretty()
    

    Message includes +3.5% which is linked as tel:3

    We had upgraded RC during the hour in between these two messages.

  • Related Issue: This feature is not currently disableable due to bug No Administration > Messages > AutoLinker Settings working since updating to 5.0.3 #27135

  • Related Issue: Just as AutoLinker Phone is overly aggressive, so too AutoLinker TLD URLs is overly agressive. Autolinker autolinks anything with a dot in it #26476

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions