diff options
author | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2010-02-25 00:52:27 +0000 |
---|---|---|
committer | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2010-02-25 00:52:27 +0000 |
commit | f8b3a85b79b8eb74c37c839079ecbf8266a6f4ed (patch) | |
tree | ced1b724e207ab15c0c21c198bb3105639e57ff4 /cgi-bin/template.c | |
parent | 41681883895f928191cfa6472b453d9753cc26ec (diff) | |
download | cups-f8b3a85b79b8eb74c37c839079ecbf8266a6f4ed.tar.gz |
Merge changes from CUPS 1.5svn-r9000.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@1912 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'cgi-bin/template.c')
-rw-r--r-- | cgi-bin/template.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/cgi-bin/template.c b/cgi-bin/template.c index 6e9cc5ec6..8ec653878 100644 --- a/cgi-bin/template.c +++ b/cgi-bin/template.c @@ -3,7 +3,7 @@ * * CGI template function. * - * Copyright 2007-2008 by Apple Inc. + * Copyright 2007-2010 by Apple Inc. * Copyright 1997-2006 by Easy Software Products. * * These coded instructions, statements, and computer programs are the @@ -369,6 +369,20 @@ cgi_copy(FILE *out, /* I - Output file */ continue; } + else if (name[0] == '$') + { + /* + * Insert cookie value or nothing if not defined. + */ + + if ((value = cgiGetCookie(name + 1)) != NULL) + outptr = value; + else + { + outval[0] = '\0'; + outptr = outval; + } + } else { /* @@ -437,7 +451,14 @@ cgi_copy(FILE *out, /* I - Output file */ * Test for existance... */ - result = cgiGetArray(name, element) != NULL && outptr[0]; + if (name[0] == '?') + result = cgiGetArray(name + 1, element) != NULL; + else if (name[0] == '#') + result = cgiGetVariable(name + 1) != NULL; + else + result = cgiGetArray(name, element) != NULL; + + result = result && outptr[0]; compare[0] = '\0'; } else |