consider the following drive path (note the single quote):
/foo/bar's/child.txt
calling:
my $children = $gd->children( "/foo/bar's" );
fails with 400 error.
google drive api docs says you have to escape single quotes.
https://developers.google.com/drive/api/v2/ref-search-terms
so I tried calling:
my $children = $gd->children( "/foo/bar\'s" );
which sort of works (no 400 error), but also returns no children.
no children are returned, because in Simple.pm, line 363:
if ( $child->title() eq $part ) {
The condition fails, and it doesn't recurse into the folder.
$part = /foo/bar\'s
but
$title = /foo/bar's
In Simple.pm, line 449, updating the query opts to escape single quotes in title seems to fix this:
my $title = $search_opts->{title};$title =~ s/\'/\\\'/g; # escape single quotes$opts->{'q'} .= " AND title = '$title'"; # ' fix for poor editors
and allows the original query to work without user escaping:
my $children = $gd->children( "/foo/bar's" );
There are probably other query locations where title should be escaped, but this get's me past this one case.
consider the following drive path (note the single quote): /foo/bar's/child.txt
calling:
my $children = $gd->children( "/foo/bar's" );
fails with 400 error.google drive api docs says you have to escape single quotes. https://developers.google.com/drive/api/v2/ref-search-terms so I tried calling:
my $children = $gd->children( "/foo/bar\'s" );
which sort of works (no 400 error), but also returns no children.no children are returned, because in Simple.pm, line 363:
if ( $child->title() eq $part ) {
The condition fails, and it doesn't recurse into the folder.$part = /foo/bar\'s
but$title = /foo/bar's
In Simple.pm, line 449, updating the query opts to escape single quotes in title seems to fix this:
my $title = $search_opts->{title};
$title =~ s/\'/\\\'/g; # escape single quotes
$opts->{'q'} .= " AND title = '$title'"; # ' fix for poor editors
and allows the original query to work without user escaping:my $children = $gd->children( "/foo/bar's" );
There are probably other query locations where title should be escaped, but this get's me past this one case.