Skip to content

Problem with + in file name #13

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

3 participants

@Arvi3d
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
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;

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.