Re: Add Series from cgi fails.

2013-07-05 Thread dinkypumpkin

On 28/06/2013 15:28, Arthur Murray wrote:

On Fri, Jun 28, 2013 at 4:58 AM, dinkypumpkin  wrote:

This patch escapes every non-alphanumeric character in the programme name
and then removes the escaping from whitespace characters for readability.
The question mark is probably the only problematic character likely to
appear in programme names, but we might as well make the escaping generic.
If this change works for you I'll merge it into get_iplayer.


Yes the patch works for me, thanks.


This patch is now in the Git repo.

https://github.com/dinkypumpkin/get_iplayer/commit/87a6019667d1f1ae9480906ee9a29c4c580a1987.patch


___
get_iplayer mailing list
get_iplayer@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/get_iplayer


Re: Add Series from cgi fails.

2013-06-28 Thread Arthur Murray
On Fri, Jun 28, 2013 at 4:58 AM, dinkypumpkin  wrote:
> This patch escapes every non-alphanumeric character in the programme name
> and then removes the escaping from whitespace characters for readability.
> The question mark is probably the only problematic character likely to
> appear in programme names, but we might as well make the escaping generic.
> If this change works for you I'll merge it into get_iplayer.

Yes the patch works for me, thanks.

___
get_iplayer mailing list
get_iplayer@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/get_iplayer


Re: Add Series from cgi fails.

2013-06-28 Thread dinkypumpkin

On 28/06/2013 00:18, Arthur Murray wrote:

Using "Add Series" from the get_iplayer.cgi on a prog name with a
question mark in it ("Who Were the Greeks?") fills in the "search0"
field of the pvr file with the question mark and therefore does not
match. (search0 ^Who Were the Greeks?$).  If the question mark is
escaped it will match (search0 ^Who Were the Greeks\?$).  What is the
correct place to correct this, in the cgi, or in get_iplayer and
specifically where?

(Encoding the question mark to ? doesn't work, only escaping it does.)

# from cgi
# Add Series
$links .= label( {
 -id=>'nowrap',
 -class=>'search pointer_noul',
 -title=>"Add Series '$prog{$pid}->{name}' to PVR",
 -onClick=>"BackupFormVars(form);
form.NEXTPAGE.value='pvr_add';
form.SEARCH.value='".encode_entities("^$prog{$pid}->{name}\$")."'; ...


Sample of ugly fixing in cgi:

  my $encoded = encode_entities("^$prog{$pid}->{name}\$");
  $encoded =~ s/\?/\\\?/;

... form.SEARCH.value='$encoded';  ...


You're in the right place.  Try this patch:

https://github.com/dinkypumpkin/get_iplayer/commit/e43249cb3e857fffed07601d67c190d641076be8

You can apply it directly from:

https://github.com/dinkypumpkin/get_iplayer/commit/e43249cb3e857fffed07601d67c190d641076be8.patch

This patch escapes every non-alphanumeric character in the programme 
name and then removes the escaping from whitespace characters for 
readability.  The question mark is probably the only problematic 
character likely to appear in programme names, but we might as well make 
the escaping generic.  If this change works for you I'll merge it into 
get_iplayer.




___
get_iplayer mailing list
get_iplayer@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/get_iplayer