Ticket #3783: mythweb_handler_patch.txt

File mythweb_handler_patch.txt, 908 bytes (added by vitaminjoe@…, 18 years ago)

Example patch to fix mythweb video module handler.php

Line 
1--- /usr/src/myth/mythplugins/mythweb/modules/video/handler.php 2007-07-30 16:26:52.000000000 -0600
2+++ handler.php 2007-07-31 12:20:42.000000000 -0600
3@@ -220,8 +220,11 @@
4 if (isset($_REQUEST['path']))
5 $_SESSION['video']['path'] = $_REQUEST['path'];
6
7- if (isset($_SESSION['video']['path']))
8- $where .= ' AND videometadata.filename RLIKE '.$db->escape($_SESSION['video']['path'].'[/]*[^/]*$');
9+ if (isset($_SESSION['video']['path'])) {
10+ $escaped_path = str_replace('(', '\\(', $_SESSION['video']['path']);
11+ $escaped_path = str_replace(')', '\\)', $escaped_path);
12+ $where .= ' AND videometadata.filename RLIKE '.$db->escape($escaped_path.'[/]*[^/]*$');
13+ }
14 // Deal with the parental locks
15 if (isset($_REQUEST['VideoAdminPassword']))
16 $_SESSION['video']['VideoAdminPassword'] =
17$_REQUEST['VideoAdminPassword'];