Ticket #1296 (closed defect: fixed)
Words in brackets, e.g., [foo], will be replaced with dialog IDs
| Reported by: | nicholasbs | Owned by: | gogo |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.96 |
| Component: | Xinha Core | Version: | trunk |
| Severity: | minor | Keywords: | |
| Cc: |
Description
The regex used in XinhaDialog?.js casts the net a little too wide:
html = html.replace(/\[([a-z0-9_]+)\]/ig,
function(fullString, id)
{
if(typeof dialog.id[id] == 'undefined')
{
dialog.id[id] = Xinha.uniq('Dialog');
dialog.r_id[dialog.id[id]] = id;
}
return dialog.id[id];
}
[SNIP]
This will replace any alphanumeric string (without spaces but including underscores) with a unique dialog ID, e.g., Dialog24. This works for making element IDs unique in a dialog, but it could also screw up other text.
The regex should be updated to look for strings of the form id="[bah]" or name='[foo]' instead.
Change History
Note: See
TracTickets for help on using
tickets.
