Ticket #8339: handler.diff

File handler.diff, 1.3 KB (added by yianniv, 10 years ago)
  • mythplugins/mythweb/modules/video/handler.php

     
    140140// Get the filesystem layout
    141141    $PATH_TREE = array();
    142142    $sh = $db->query('
    143         SELECT      DISTINCT IF(INSTR(filename,"/"), LEFT(filename, LENGTH(filename) - LOCATE("/", REVERSE(filename))), "/") AS dirname
     143        SELECT      DISTINCT IF(INSTR(filename,"/"), LEFT(filename, CHAR_LENGTH(filename) - LOCATE("/", REVERSE(filename))), "/") AS dirname
    144144        FROM        videometadata
    145145        ORDER BY    dirname');
    146146    while ($dirname = $sh->fetch_col()) {
     
    262262        $_SESSION['video']['path'] = preg_replace('#^/*#', '/', preg_replace('#/+$#', '', $_REQUEST['path']));
    263263
    264264    if (isset($_SESSION['video']['path'])) {
    265         $where .= ' AND CONCAT("/", IF(INSTR(filename,"/"), LEFT(filename, LENGTH(filename) - LOCATE("/", REVERSE(filename))), "")) = '.$db->escape($_SESSION['video']['path']);
     265        $where .= ' AND CONCAT("/", IF(INSTR(filename,"/"), LEFT(filename, CHAR_LENGTH(filename) - LOCATE("/", REVERSE(filename))), "")) = '.$db->escape($_SESSION['video']['path']);
    266266    }
    267267// Deal with the parental locks
    268268    if (isset($_REQUEST['VideoAdminPassword']))