1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-10-02 03:46:21 -04:00
This commit is contained in:
Kalle Olavi Niemitalo 2006-12-02 01:22:30 +02:00 committed by Kalle Olavi Niemitalo
commit a3c27ee02e
3 changed files with 57 additions and 1 deletions

View File

@ -107,3 +107,9 @@ Scrool > pasky: HTML renderer doesn't work well with double-width characters. I
Scrool > What's that?
Scrool > It kills my current build.
Miciah > Scary!
%
paakku> fonseca: I think quote_level should be unsigned after all, in case it
overflows in html_quote on a 64-bit machine.
fonseca> paakku: I am curious why you especially mention 64-bit?
paakku> 64-bit because exploiting this is likely to need a 6 GB HTML page and
that is not possible on 32-bit.

View File

@ -114,7 +114,12 @@ html_quote_close(struct html_context *html_context, unsigned char *a,
unsigned char *xxx3, unsigned char *xxx4,
unsigned char **xxx5)
{
unsigned char *q = quote_char[--html_context->quote_level % 2];
unsigned char *q;
if (html_context->quote_level > 0)
html_context->quote_level--;
q = quote_char[html_context->quote_level % 2];
put_chrs(html_context, q, 1);
}

45
test/cgi/print-vars.sh Executable file
View File

@ -0,0 +1,45 @@
#!/bin/sh
#
# Print all variables set by ELinks
#
cat <<EOF
Content-Type: text/html
<html>
<head><title>CGI variables</title></head>
<body><table>
EOF
for var in \
CONTENT_LENGTH \
GATEWAY_INTERFACE \
HTTP_ACCEPT \
HTTP_ACCEPT_LANGUAGE \
HTTP_CACHE_CONTROL \
HTTP_COOKIE \
HTTP_IF_MODIFIED_SINCE \
HTTP_PRAGMA \
HTTP_REFERER \
HTTP_USER_AGENT \
PATH_TRANSLATED \
QUERY_STRING \
REDIRECT_STATUS \
REMOTE_ADDR \
REQUEST_METHOD \
SCRIPT_FILENAME \
SCRIPT_NAME \
SERVER_NAME \
SERVER_PROTOCOL \
SERVER_SOFTWARE;
do
eval val=$`echo $var`
echo "<tr><td><em>$var</em></td><td>$val</td></tr>";
done
cat <<EOF
</table>
</body>
</html>
EOF