[mythtv] [mythtv-commits] Ticket #1614: MythWeb - Recording filenames not URL encoded

Michael T. Dean mtdean at thirdcontact.com
Sun Apr 2 19:23:33 UTC 2006


On 04/02/2006 03:25 AM, MythTV wrote:
> #1614: MythWeb - Recording filenames not URL encoded
>
> Changes (by xris):
>
>   * resolution:  => fixed
>   * status:  new => closed
>
> Comment:
>
>  (In [9600]) url encode fix to hopefully close #1614

This didn't seem to work with the int'l characters.  To test, I renamed 
one of my recordings and set the basename field:

$ mv 1065_20060401220000.mpg 1065_20060401220000.mpg
$ mv 1065_20060401220000.mpg.png 1065_20060401220000.mpg.png
$ mysql -umythtv -p mythconverg -e "update recorded set basename = 
'1065_20060401220000.mpg' where basename = '1065_20060401220000.mpg';"

Once those changes had been made, the links in the Recorded Programs 
page for that recording (on the thumbnail, the title, and the subtitle) 
show up in the browser's status bar as 
"http://hostname/myth/data/recordings/1065_20060401220000.mpg" (with 
the umlaut showing) but in the HTML source as:

<tr id="inforow_2" class="recorded">
	<td class="list" rowspan="2">&nbsp;</td>
	<td rowspan="2"><a href="/myth/data/recordings/1065_%C3%BC20060401220000.mpg" name="2"><img id="/var/storage/mythtv/recordings/1065_20060401220000.mpg" src="/myth/data/cache/1065_%C3%BC20060401220000.mpg.png" width="160" height="120" border="0"></a></td>
    <td><a href="/myth/data/recordings/1065_20060401220000.mpg">Veronica Mars</a></td>
    <td><a href="/myth/data/recordings/1065_20060401220000.mpg">The Rapes of Graff</a></td>
	<td>Veronica's ex-boyfriend turns to her for help when he is accused of date rape.</td>
    <td>65 - <nobr>WRBW</nobr></td>

	<td nowrap align="center">Default</td>
    <td nowrap align="center">Sat Apr  1, 2006<br />(10:00 PM)</td>
    <td nowrap>1 hr</td>
    <td nowrap>1.1 GB</td>
    <td width="5%" rowspan="1" class="command command_border_l command_border_t command_border_b command_border_r" align="center">
        <a id="delete_2"
            href="/myth/tv/recorded?delete=yes&chanid=1065&starttime=1143946800"
            js_href="javascript:confirm_delete(2, false)";
            title="Delete Veronica Mars: The Rapes of Graff"
            >Delete</a>

    </td>
</tr>


Notice that the links for the image (the anchor's href and the image's 
source) are escaped (and, BTW, the image shows properly), but the 
image's id and the links for title and subtitle aren't escaped.  When I 
click any of the links (image, title, or subtitle), I get a 404.  The 
URL it uses (regardless of which link I click) is 
"https://hostname/myth/data/recordings/1065_%C3%BC20060401220000.mpg" 
(escaped), so I think FF is escaping the umlaut.  The message for the 
404 says:

Not Found
The requested URL /myth/data/recordings/1065_ü20060401220000.mpg was 
not found on this server.

(with a capital A with a tilde followed by 1/4).  The error page 
specifies "Content-Type: text/html; charset=iso-8859-1" (thus the 
different characters).

Oh, the file itself is 1.1GiB, so it's not the Apache 2GiB file limit.  
To be extra sure, I did the same with a 600MB recording, with the same 
results.

In case it's important, the Object definition at the top of the page is:

    file = new Object();
    file.title     = 'Veronica Mars';
    file.subtitle  = 'The Rapes of Graff';
    file.chanid    = '1065';
    file.starttime = '1143946800';
    file.group     = '';
    file.filename  = '/var/storage/mythtv/recordings/1065_%C3%BC20060401220000.mpg';
    file.size      = '1229546440';
    file.length    = '3600';
    files.push(file);


However, I'll admit that my system is set up for US English, so feel 
free to say I can't do int'l characters (I really don't need to use 
them, but was trying to ensure the issue is fixed for everyone), and 
I'll assume it's fixed for those who are using other locales (locales 
that include the characters of interest).

My Apache config specifies Apache's default "AddDefaultCharset 
ISO-8859-1" and all the default "AddCharset" lines (that associate 
charsets with file extensions).  However, MythWeb headers for the page 
include "Content-Type: text/html; charset=utf-8", so the settings are 
not being used.  Also, I'm not using mod_security and don't have 
"SecFilterCheckUnicodeEncoding" or "SecFilterCheckURLEncoding" 
specified.  Even when I change the default charset to UTF-8, it fails to 
work.

Apache's error log shows:
[Sun Apr 02 15:01:10 2006] [error] [client xxx.xx.xx.xx] File does not 
exist: 
/var/www/htdocs/myth/data/recordings/1065_\xc3\xbc20060401220000.mpg, 
referer: https://hostname/myth/tv/recorded

Hope this is useful.  Sorry there's so much info, but I wasn't sure what 
was/was not important.  (BTW, I had come up with a patch very similar to 
yours, but still couldn't make it work, which is why I punted and 
submitted the ticket without a patch. :)

Thanks,
Mike


More information about the mythtv-dev mailing list