Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
WEBUI JS: epg grid - escape regex for title linking
  • Loading branch information
perexg committed Sep 28, 2014
1 parent 6352e34 commit f5872e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/webui/static/app/epg.js
Expand Up @@ -764,6 +764,7 @@ tvheadend.epg = function() {
function clicked(column, grid, index, e) {
if (column.dataIndex === 'title') {
var value = grid.getStore().getAt(index).data[column.dataIndex];
value = tvheadend.regexEscape(value);
if (value && epgStore.baseParams.title !== value) {
epgFilterTitle.setValue(value);
return false;
Expand Down
4 changes: 4 additions & 0 deletions src/webui/static/app/tvheadend.js
Expand Up @@ -10,6 +10,10 @@ Ext.state.Manager.setProvider(new Ext.state.CookieProvider({
expires: new Date(new Date().getTime() + (1000 * 60 * 60 * 24 * 7))
}));

tvheadend.regexEscape = function(s) {
return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
}

/**
* Displays a help popup window
*/
Expand Down

0 comments on commit f5872e7

Please sign in to comment.