Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with + in file name #13

Closed
Arvi3d opened this issue Apr 5, 2012 · 1 comment
Closed

Problem with + in file name #13

Arvi3d opened this issue Apr 5, 2012 · 1 comment

Comments

@Arvi3d
Copy link

Arvi3d commented Apr 5, 2012

We have a file name: vm068 - 11 - z + 3.mp3
encoding it we have:
vm068%20-%2011%20-%20z%20%2B%203.mp3

But mod_zip does not work with that.

@petrofm
Copy link

petrofm commented Jun 15, 2012

its work for me,
//ngx_http_zip_parsers.c
size_t destructive_url_decode_len(unsigned char* start, unsigned char* end)
{
unsigned char *read_pos = start, *write_pos = start;

for (; read_pos < end; read_pos++) {
unsigned char ch = *read_pos;
if (ch == '+') // replace before decoding
    ch = ' ';
if (ch == '%' && (read_pos+2 < end)) {
    ch = 16 * hex_char_value(*(read_pos+1)) + hex_char_value(*(read_pos+2));
    read_pos += 2;
    }

// if (ch == '+') //original - replace after encoding
// ch = ' ';
*(write_pos++) = ch;
}

return write_pos - start;

}

evanmiller added a commit that referenced this issue Sep 20, 2013
Fixed an issue with "+" in the filename, issue #13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants