Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#3131 closed patch (fixed)

Remove double escaping of backslash and quote when registering keys/jumps

Reported by: sphery <mtdean@…> Owned by: stuartm
Priority: minor Milestone: 0.21
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no


The attached patch removes the in-application-code escaping of the backslash and quote characters in RegisterKey?() and RegisterJump?().

[6456] modified the MythMainWindow::RegisterKey?() and MythMainWindow::RegisterJump?() functions to use a prepared query and bindValue() rather than using arg() to build up the SQL statement (see , old lines 476-506, new lines 505-539). Since bindValue() escapes characters in strings, the in-Myth escaping is no longer necessary. Note that both SVN trunk and 0.20-fixes are affected by this bug.

With the double escaping, the Mute action, whose default keybinding is '|,\,F9' is written to the database with a value of '|,
,F9'. Because '
' is not a valid key sequence, the list of keys is not parsed properly, resulting in '|' being the only usable key for Mute.

This issue will only affect users for whom there is no binding for the Mute action. Those who had already specified a binding prior to the time we started using mythui were unaffected. Therefore, once fixed, this patch will ensure users creating new database have a valid keybinding for Mute.

Users who have recreated the binding using MythControls will also have valid bindings, since MythControls worked, in spite of Myth's double-escaping, because it does not reuse the RegisterKey?() or RegisterJump?() functions. Instead, MythControls reimplements the functionality in KeyBindings::CommitAction?() and KeyBindings::CommitJumppoint?(), but without the double escaping.

I did not implement a "fix" for the bad data in dbcheck.cpp. Users affected by the bug can simply redefine their keybindings using MythControls.

Attachments (1)

mythtv-keybinding_jump-double_escaping.patch (864 bytes) - added by sphery <mtdean@…> 14 years ago.

Download all attachments as: .zip

Change History (4)

Changed 14 years ago by sphery <mtdean@…>

comment:1 Changed 14 years ago by stuartm

Milestone: unknown0.21
Owner: changed from Isaac Richards to stuartm

comment:2 Changed 14 years ago by stuartm

Resolution: fixed
Status: newclosed

(In [13260]) Closes #3131

Removes unnecessary escaping of backslashes and double quotes in MythMainWindow::RegisterKey? and MythMainWindow::RegisterJump?

Update the keybindings and jumppoints table to remove extra backslashes inserted as a result of the escaping.

comment:3 Changed 14 years ago by stuartm

(In [13261]) Refs #3131

Backports the mythmainwindow.cpp part of [13260] to -fixes.

Removes unnecessary escaping of backslashes and double quotes in MythMainWindow::RegisterKey? and MythMainWindow::RegisterJump?

The DB update isn't included because it's not practical to backport schema changes.

Note: See TracTickets for help on using tickets.