Bug Tracker

Modify

Ticket #2018 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

Small bug in the autocomplete plugin

Reported by: ash Owned by:
Priority: major Milestone: 1.2.2
Component: plugin Version: 1.2.1
Keywords: autocomplete Cc:
Blocking: Blocked by:

Description

There is a problem with the autocomplete plugin.

Take a look at

 http://jqueryjs.googlecode.com/svn/trunk/plugins/autocomplete/jquery.autocomplete.js

around line 510

The highlight function constructs a RegExp by concatinating strings, one of which is term. Term is entered by the client. If it contains special symbols like '(' - the constructor of the RegExp fails.

Workarounds: set another highlight function.

Fix: Escape the term string.

I am attaching a patch that works for me. There is a static regexp in there that can be optimized further.

Attachments

jquery.autocomplete.js.diff Download (648 bytes) - added by ash 5 years ago.
Trivial patch

Change History

Changed 5 years ago by ash

Trivial patch

comment:1 Changed 5 years ago by joern

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in [4107].

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.