diff options
author | Christian Hesse <mail@eworm.de> | 2013-11-28 09:34:44 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2013-11-28 09:34:44 +0100 |
commit | b66003a3cae3adad2183bbc010a3a28664323024 (patch) | |
tree | d88fcd39a9adfa3376bf9af3d2a364c721f1dcd1 /cqrlogo.c | |
parent | 11daccdfd338b6d397c9d70ca2118c3cdd7f6283 (diff) | |
download | cqrlogo-b66003a3cae3adad2183bbc010a3a28664323024.tar.gz cqrlogo-b66003a3cae3adad2183bbc010a3a28664323024.tar.zst |
move query string handling below referer handling
Diffstat (limited to 'cqrlogo.c')
-rw-r--r-- | cqrlogo.c | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -247,18 +247,6 @@ int main(int argc, char **argv) { uri_server_name = malloc(10 + strlen(server_name)); sprintf(uri_server_name, "http%s://%s/", https ? "s" : "", server_name); - /* get query string and read settings */ - if ((query_string = getenv("QUERY_STRING")) != NULL) { - /* do we have a special scale? */ - get_value(query_string, "scale", &scale, QRCODE_SCALE, 1, QRCODE_MAX_SCALE); - - /* width of the border? */ - get_value(query_string, "border", &border, QRCODE_BORDER, 0, QRCODE_MAX_BORDER); - - /* error correction level? */ - get_value(query_string, "level", &level, QRCODE_LEVEL, 0, QR_ECLEVEL_H); - } - /* get http referer */ if ((http_referer = getenv("HTTP_REFERER")) != NULL) { uri = http_referer; @@ -285,6 +273,18 @@ int main(int argc, char **argv) { uri = uri_server_name; } + /* get query string and read settings */ + if ((query_string = getenv("QUERY_STRING")) != NULL) { + /* do we have a special scale? */ + get_value(query_string, "scale", &scale, QRCODE_SCALE, 1, QRCODE_MAX_SCALE); + + /* width of the border? */ + get_value(query_string, "border", &border, QRCODE_BORDER, 0, QRCODE_MAX_BORDER); + + /* error correction level? */ + get_value(query_string, "level", &level, QRCODE_LEVEL, 0, QR_ECLEVEL_H); + } + /* encode the QR-Code */ if ((bitmap = encode_qrcode(uri, scale, border, level)) == NULL) { /* uri too long? retry with uri from server name */ |