[PHP-CVS] cvs: php-src /ext/standard head.c

2008-06-09 Thread Rasmus Lerdorf
rasmus  Mon Jun  9 14:05:49 2008 UTC

  Modified files:  
/php-src/ext/standard   head.c 
  Log:
  Merge from PHP_5 - don't echo raw cookie values here
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/head.c?r1=1.99r2=1.100diff_format=u
Index: php-src/ext/standard/head.c
diff -u php-src/ext/standard/head.c:1.99 php-src/ext/standard/head.c:1.100
--- php-src/ext/standard/head.c:1.99Thu Feb 28 14:16:14 2008
+++ php-src/ext/standard/head.c Mon Jun  9 14:05:49 2008
@@ -15,7 +15,7 @@
| Author: Rasmus Lerdorf [EMAIL PROTECTED]|
+--+
  */
-/* $Id: head.c,v 1.99 2008/02/28 14:16:14 felipe Exp $ */
+/* $Id: head.c,v 1.100 2008/06/09 14:05:49 rasmus Exp $ */
 
 #include stdio.h
 #include php.h
@@ -70,12 +70,12 @@
int result;

if (name  strpbrk(name, =,; \t\r\n\013\014) != NULL) {   /* man 
isspace for \013 and \014 */
-   zend_error( E_WARNING, Cookie names can not contain any of the 
folllowing '=,; \\t\\r\\n\\013\\014' (%s), name );
+   zend_error( E_WARNING, Cookie names can not contain any of the 
folllowing '=,; \\t\\r\\n\\013\\014' );
return FAILURE;
}
 
if (!url_encode  value  strpbrk(value, ,; \t\r\n\013\014) != 
NULL) { /* man isspace for \013 and \014 */
-   zend_error( E_WARNING, Cookie values can not contain any of 
the folllowing ',; \\t\\r\\n\\013\\014' (%s), value );
+   zend_error( E_WARNING, Cookie values can not contain any of 
the folllowing ',; \\t\\r\\n\\013\\014' );
return FAILURE;
}
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard head.c

2007-04-16 Thread Antony Dovgal
tony2001Mon Apr 16 12:49:07 2007 UTC

  Modified files:  
/php-src/ext/standard   head.c 
  Log:
  MFB use strlcat()
  fix buffer overrun  bug #41101
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/head.c?r1=1.95r2=1.96diff_format=u
Index: php-src/ext/standard/head.c
diff -u php-src/ext/standard/head.c:1.95 php-src/ext/standard/head.c:1.96
--- php-src/ext/standard/head.c:1.95Sat Feb 24 16:25:55 2007
+++ php-src/ext/standard/head.c Mon Apr 16 12:49:07 2007
@@ -15,7 +15,7 @@
| Author: Rasmus Lerdorf [EMAIL PROTECTED]|
+--+
  */
-/* $Id: head.c,v 1.95 2007/02/24 16:25:55 helly Exp $ */
+/* $Id: head.c,v 1.96 2007/04/16 12:49:07 tony2001 Exp $ */
 
 #include stdio.h
 #include php.h
@@ -94,6 +94,9 @@
if (domain) {
len += domain_len;
}
+
+   cookie = emalloc(len + 100);
+
if (value  value_len == 0) {
/* 
 * MSIE doesn't delete a cookie when you set it to a null value
@@ -102,14 +105,14 @@
 */
time_t t = time(NULL) - 31536001;
dt = php_format_date(D, d-M-Y H:i:s T, sizeof(D, d-M-Y H:i:s 
T)-1, t, 0 TSRMLS_CC);
-   spprintf(cookie, 0, Set-Cookie: %s=deleted; expires=%s, 
name, dt);
+   snprintf(cookie, len + 100, Set-Cookie: %s=deleted; 
expires=%s, name, dt);
efree(dt);
} else {
-   spprintf(cookie, 0, Set-Cookie: %s=%s, name, value ? 
encoded_value : );
+   snprintf(cookie, len + 100, Set-Cookie: %s=%s, name, value ? 
encoded_value : );
if (expires  0) {
-   strcat(cookie, ; expires=);
+   strlcat(cookie, ; expires=, len + 100);
dt = php_format_date(D, d-M-Y H:i:s T, sizeof(D, 
d-M-Y H:i:s T)-1, expires, 0 TSRMLS_CC);
-   strcat(cookie, dt);
+   strlcat(cookie, dt, len + 100);
efree(dt);
}
}
@@ -119,18 +122,18 @@
}
 
if (path  path_len  0) {
-   strcat(cookie, ; path=);
-   strcat(cookie, path);
+   strlcat(cookie, ; path=, len + 100);
+   strlcat(cookie, path, len + 100);
}
if (domain  domain_len  0) {
-   strcat(cookie, ; domain=);
-   strcat(cookie, domain);
+   strlcat(cookie, ; domain=, len + 100);
+   strlcat(cookie, domain, len + 100);
}
if (secure) {
-   strcat(cookie, ; secure);
+   strlcat(cookie, ; secure, len + 100);
}
if (httponly) {
-   strcat(cookie, ; httponly);
+   strlcat(cookie, ; httponly, len + 100);
}
 
ctr.line = cookie;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard head.c

2006-12-04 Thread Andrei Zmievski
andrei  Mon Dec  4 20:43:42 2006 UTC

  Modified files:  
/php-src/ext/standard   head.c 
  Log:
  Make headers-related functions accept Unicode strings, but only if their
  contents can be converted to ASCII.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/head.c?r1=1.92r2=1.93diff_format=u
Index: php-src/ext/standard/head.c
diff -u php-src/ext/standard/head.c:1.92 php-src/ext/standard/head.c:1.93
--- php-src/ext/standard/head.c:1.92Thu Oct 19 20:55:08 2006
+++ php-src/ext/standard/head.c Mon Dec  4 20:43:42 2006
@@ -15,7 +15,7 @@
| Author: Rasmus Lerdorf [EMAIL PROTECTED]|
+--+
  */
-/* $Id: head.c,v 1.92 2006/10/19 20:55:08 andrei Exp $ */
+/* $Id: head.c,v 1.93 2006/12/04 20:43:42 andrei Exp $ */
 
 #include stdio.h
 #include php.h
@@ -34,16 +34,17 @@
 
 
 /* Implementation of the language Header() function */
-/* {{{ proto void header(string header [, bool replace, [int 
http_response_code]])
+/* {{{ proto void header(string header [, bool replace, [int 
http_response_code]]) U
Sends a raw HTTP header */
 PHP_FUNCTION(header)
 {
zend_bool rep = 1;
sapi_header_line ctr = {0};

-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|bl, ctr.line,
-   ctr.line_len, rep, ctr.response_code) == 
FAILURE)
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|bl, ctr.line,
+   ctr.line_len, UG(ascii_conv), rep, 
ctr.response_code) == FAILURE) {
return;
+   }

sapi_header_op(rep ? SAPI_HEADER_REPLACE:SAPI_HEADER_ADD, ctr 
TSRMLS_CC);
 }
@@ -144,7 +145,7 @@
 
 
 /* php_set_cookie(name, value, expires, path, domain, secure) */
-/* {{{ proto bool setcookie(string name [, string value [, int expires [, 
string path [, string domain [, bool secure[, bool httponly]])
+/* {{{ proto bool setcookie(string name [, string value [, int expires [, 
string path [, string domain [, bool secure[, bool httponly]]) U
Send a cookie */
 PHP_FUNCTION(setcookie)
 {
@@ -153,9 +154,11 @@
zend_bool secure = 0, httponly = 0;
int name_len, value_len = 0, path_len = 0, domain_len = 0;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|slssbb, name,
- name_len, value, 
value_len, expires, path,
- path_len, domain, 
domain_len, secure, httponly) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|slssbb, 
name,
+ name_len, 
UG(ascii_conv), value, value_len,
+ UG(ascii_conv), 
expires, path, path_len,
+ UG(ascii_conv), 
domain, domain_len,
+ UG(ascii_conv), 
secure, httponly) == FAILURE) {
return;
}
 
@@ -167,7 +170,7 @@
 }
 /* }}} */
 
-/* {{{ proto bool setrawcookie(string name [, string value [, int expires [, 
string path [, string domain [, bool secure[, bool httponly]])
+/* {{{ proto bool setrawcookie(string name [, string value [, int expires [, 
string path [, string domain [, bool secure[, bool httponly]]) U
Send a cookie with no url encoding of the value */
 PHP_FUNCTION(setrawcookie)
 {
@@ -176,9 +179,11 @@
zend_bool secure = 0, httponly = 0;
int name_len, value_len = 0, path_len = 0, domain_len = 0;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|slssbb, name,
- name_len, value, 
value_len, expires, path,
- path_len, domain, 
domain_len, secure, httponly) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|slssbb, 
name,
+ name_len, 
UG(ascii_conv), value, value_len,
+ UG(ascii_conv), 
expires, path, path_len,
+ UG(ascii_conv), 
domain, domain_len,
+ UG(ascii_conv), 
secure, httponly) == FAILURE) {
return;
}
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard head.c

2006-10-19 Thread Andrei Zmievski
andrei  Thu Oct 19 17:55:33 2006 UTC

  Modified files:  
/php-src/ext/standard   head.c 
  Log:
  Unicode support for headers_sent().
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/head.c?r1=1.90r2=1.91diff_format=u
Index: php-src/ext/standard/head.c
diff -u php-src/ext/standard/head.c:1.90 php-src/ext/standard/head.c:1.91
--- php-src/ext/standard/head.c:1.90Mon Oct 16 19:27:00 2006
+++ php-src/ext/standard/head.c Thu Oct 19 17:55:33 2006
@@ -15,7 +15,7 @@
| Author: Rasmus Lerdorf [EMAIL PROTECTED]|
+--+
  */
-/* $Id: head.c,v 1.90 2006/10/16 19:27:00 tony2001 Exp $ */
+/* $Id: head.c,v 1.91 2006/10/19 17:55:33 andrei Exp $ */
 
 #include stdio.h
 #include php.h
@@ -191,7 +191,7 @@
 /* }}} */
 
 
-/* {{{ proto bool headers_sent([string $file [, int $line]])
+/* {{{ proto bool headers_sent([string $file [, int $line]]) U
Returns true if headers have already been sent, false otherwise */
 PHP_FUNCTION(headers_sent)
 {
@@ -208,17 +208,28 @@
}
 
switch(ZEND_NUM_ARGS()) {
-   case 2:
-   zval_dtor(arg2);
-   ZVAL_LONG(arg2, line);
-   case 1:
-   zval_dtor(arg1);
-   if (file) { 
-   ZVAL_STRING(arg1, file, 1);
-   } else {
-   ZVAL_STRING(arg1, , 1);
-   }   
-   break;
+   case 2:
+   zval_dtor(arg2);
+   ZVAL_LONG(arg2, line);
+   case 1:
+   zval_dtor(arg1);
+   if (UG(unicode)) {
+   UChar *ufile;
+   int ufile_len;
+
+   if (file  SUCCESS == 
php_stream_path_decode(NULL, ufile, ufile_len, file, strlen(file), 
REPORT_ERRORS, FG(default_context))) {
+   ZVAL_UNICODEL(arg1, ufile, ufile_len, 
0);
+   } else {
+   ZVAL_EMPTY_UNICODE(arg1);
+   }
+   } else {
+   if (file) {
+   ZVAL_STRING(arg1, file, 1);
+   } else {
+   ZVAL_STRING(arg1, , 1);
+   }   
+   }
+   break;
}
 
if (SG(headers_sent)) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard head.c info.c

2006-10-19 Thread Andrei Zmievski
andrei  Thu Oct 19 20:55:08 2006 UTC

  Modified files:  
/php-src/ext/standard   head.c info.c 
  Log:
  Pick some low-hanging fruit.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/head.c?r1=1.91r2=1.92diff_format=u
Index: php-src/ext/standard/head.c
diff -u php-src/ext/standard/head.c:1.91 php-src/ext/standard/head.c:1.92
--- php-src/ext/standard/head.c:1.91Thu Oct 19 17:55:33 2006
+++ php-src/ext/standard/head.c Thu Oct 19 20:55:08 2006
@@ -15,7 +15,7 @@
| Author: Rasmus Lerdorf [EMAIL PROTECTED]|
+--+
  */
-/* $Id: head.c,v 1.91 2006/10/19 17:55:33 andrei Exp $ */
+/* $Id: head.c,v 1.92 2006/10/19 20:55:08 andrei Exp $ */
 
 #include stdio.h
 #include php.h
@@ -247,11 +247,11 @@
sapi_header_struct *sapi_header = (sapi_header_struct *)data;
 
if (arg  sapi_header) {
-   add_next_index_string((zval *)arg, (char 
*)(sapi_header-header), 1);
+   add_next_index_ascii_string((zval *)arg, (char 
*)(sapi_header-header), 1);
}
 }
 
-/* {{{ proto array headers_list(void)
+/* {{{ proto array headers_list(void) U
Return list of headers to be sent / already sent */
 PHP_FUNCTION(headers_list)
 {
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/info.c?r1=1.269r2=1.270diff_format=u
Index: php-src/ext/standard/info.c
diff -u php-src/ext/standard/info.c:1.269 php-src/ext/standard/info.c:1.270
--- php-src/ext/standard/info.c:1.269   Tue Sep 19 10:38:31 2006
+++ php-src/ext/standard/info.c Thu Oct 19 20:55:08 2006
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: info.c,v 1.269 2006/09/19 10:38:31 dmitry Exp $ */
+/* $Id: info.c,v 1.270 2006/10/19 20:55:08 andrei Exp $ */
 
 #include php.h
 #include php_ini.h
@@ -1004,25 +1004,26 @@
 
 /* }}} */
 
-/* {{{ proto string phpversion([string extension])
+/* {{{ proto string phpversion([string extension]) U
Return the current PHP version */
 PHP_FUNCTION(phpversion)
 {
-   zval **arg;
-   int argc = ZEND_NUM_ARGS();
+   char *ext_name = NULL;
+   int ext_name_len = 0;
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |s, ext_name, 
ext_name_len) == FAILURE) {
+   return;
+   }
 
-   if (argc == 0) {
+   if (!ext_name) {
RETURN_ASCII_STRING(PHP_VERSION, 1);
-   } else if (argc == 1  zend_get_parameters_ex(1, arg) == SUCCESS) {
+   } else {
char *version;
-   convert_to_string_ex(arg);
-   version = zend_get_module_version(Z_STRVAL_PP(arg));
+   version = zend_get_module_version(ext_name);
if (version == NULL) {
RETURN_FALSE;
}
RETURN_ASCII_STRING(version, 1);
-   } else {
-   WRONG_PARAM_COUNT;
}
 }
 /* }}} */
@@ -1071,62 +1072,60 @@
 }
 /* }}} */
 
-/* {{{ proto string php_logo_guid(void)
+/* {{{ proto string php_logo_guid(void) U
Return the special ID used to request the PHP logo in phpinfo screens*/
 PHP_FUNCTION(php_logo_guid)
 {
-
-   if (ZEND_NUM_ARGS() != 0) {
-   WRONG_PARAM_COUNT;
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ) == FAILURE) {
+   return;
}
 
-   RETURN_ASCII_STRING(php_logo_guid(), 0);
+   RETURN_ASCII_STRING(php_logo_guid(), ZSTR_AUTOFREE);
 }
 /* }}} */
 
-/* {{{ proto string php_real_logo_guid(void)
+/* {{{ proto string php_real_logo_guid(void) U
Return the special ID used to request the PHP logo in phpinfo screens*/
 PHP_FUNCTION(php_real_logo_guid)
 {
-
-   if (ZEND_NUM_ARGS() != 0) {
-   WRONG_PARAM_COUNT;
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ) == FAILURE) {
+   return;
}
 
RETURN_ASCII_STRINGL(PHP_LOGO_GUID, sizeof(PHP_LOGO_GUID)-1, 1);
 }
 /* }}} */
 
-/* {{{ proto string php_egg_logo_guid(void)
+/* {{{ proto string php_egg_logo_guid(void) U
Return the special ID used to request the PHP logo in phpinfo screens*/
 PHP_FUNCTION(php_egg_logo_guid)
 {
-   if (ZEND_NUM_ARGS() != 0) {
-   WRONG_PARAM_COUNT;
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ) == FAILURE) {
+   return;
}
 
RETURN_ASCII_STRINGL(PHP_EGG_LOGO_GUID, sizeof(PHP_EGG_LOGO_GUID)-1, 1);
 }
 /* }}} */
 
-/* {{{ proto string zend_logo_guid(void)
+/* {{{ proto string zend_logo_guid(void) U
Return the special ID used to request the Zend logo in phpinfo screens*/
 PHP_FUNCTION(zend_logo_guid)
 {
-   if (ZEND_NUM_ARGS() != 0) {
-   WRONG_PARAM_COUNT;
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ) == FAILURE) {
+   return;
}
 
RETURN_ASCII_STRINGL(ZEND_LOGO_GUID, sizeof(ZEND_LOGO_GUID)-1, 1);
 }
 /* }}} */
 
-/* {{{ proto string php_sapi_name(void)
+/* {{{ 

[PHP-CVS] cvs: php-src /ext/standard head.c

2006-10-16 Thread Antony Dovgal
tony2001Mon Oct 16 19:27:00 2006 UTC

  Modified files:  
/php-src/ext/standard   head.c 
  Log:
  initialize optional variables
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/head.c?r1=1.89r2=1.90diff_format=u
Index: php-src/ext/standard/head.c
diff -u php-src/ext/standard/head.c:1.89 php-src/ext/standard/head.c:1.90
--- php-src/ext/standard/head.c:1.89Thu Aug 10 13:56:54 2006
+++ php-src/ext/standard/head.c Mon Oct 16 19:27:00 2006
@@ -15,7 +15,7 @@
| Author: Rasmus Lerdorf [EMAIL PROTECTED]|
+--+
  */
-/* $Id: head.c,v 1.89 2006/08/10 13:56:54 iliaa Exp $ */
+/* $Id: head.c,v 1.90 2006/10/16 19:27:00 tony2001 Exp $ */
 
 #include stdio.h
 #include php.h
@@ -151,7 +151,7 @@
char *name, *value = NULL, *path = NULL, *domain = NULL;
long expires = 0;
zend_bool secure = 0, httponly = 0;
-   int name_len, value_len, path_len, domain_len;
+   int name_len, value_len = 0, path_len = 0, domain_len = 0;
 
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|slssbb, name,
  name_len, value, 
value_len, expires, path,
@@ -174,7 +174,7 @@
char *name, *value = NULL, *path = NULL, *domain = NULL;
long expires = 0;
zend_bool secure = 0, httponly = 0;
-   int name_len, value_len, path_len, domain_len;
+   int name_len, value_len = 0, path_len = 0, domain_len = 0;
 
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|slssbb, name,
  name_len, value, 
value_len, expires, path,

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard head.c

2005-07-08 Thread Antony Dovgal
tony2001Fri Jul  8 08:39:52 2005 EDT

  Modified files:  
/php-src/ext/standard   head.c 
  Log:
  make use of T token
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/head.c?r1=1.79r2=1.80ty=u
Index: php-src/ext/standard/head.c
diff -u php-src/ext/standard/head.c:1.79 php-src/ext/standard/head.c:1.80
--- php-src/ext/standard/head.c:1.79Fri Jul  8 08:30:24 2005
+++ php-src/ext/standard/head.c Fri Jul  8 08:39:51 2005
@@ -15,7 +15,7 @@
| Author: Rasmus Lerdorf [EMAIL PROTECTED]|
+--+
  */
-/* $Id: head.c,v 1.79 2005/07/08 12:30:24 tony2001 Exp $ */
+/* $Id: head.c,v 1.80 2005/07/08 12:39:51 tony2001 Exp $ */
 
 #include stdio.h
 #include php.h
@@ -104,16 +104,15 @@
 * pick an expiry date 1 year and 1 second in the past
 */
t = time(NULL) - 31536001;
-   dt = php_format_date(D, d-M-Y H:i:s, sizeof(D, d-M-Y 
H:i:s)-1, t, 0);
-   sprintf(cookie, Set-Cookie: %s=deleted; expires=%s GMT, name, 
dt);
+   dt = php_format_date(D, d-M-Y H:i:s T, sizeof(D, d-M-Y H:i:s 
T)-1, t, 0);
+   sprintf(cookie, Set-Cookie: %s=deleted; expires=%s, name, dt);
efree(dt);
} else {
sprintf(cookie, Set-Cookie: %s=%s, name, value ? 
encoded_value : );
if (expires  0) {
strcat(cookie, ; expires=);
-   dt = php_format_date(D, d-M-Y H:i:s, sizeof(D, d-M-Y 
H:i:s)-1, t, 0);
+   dt = php_format_date(D, d-M-Y H:i:s T, sizeof(D, 
d-M-Y H:i:s T)-1, t, 0);
strcat(cookie, dt);
-   strcat(cookie,  GMT);
efree(dt);
}
}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard head.c

2005-07-08 Thread Ilia Alshanetsky
iliaa   Fri Jul  8 12:06:08 2005 EDT

  Modified files:  
/php-src/ext/standard   head.c 
  Log:
  Fixed compiler warning.
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/head.c?r1=1.80r2=1.81ty=u
Index: php-src/ext/standard/head.c
diff -u php-src/ext/standard/head.c:1.80 php-src/ext/standard/head.c:1.81
--- php-src/ext/standard/head.c:1.80Fri Jul  8 08:39:51 2005
+++ php-src/ext/standard/head.c Fri Jul  8 12:06:05 2005
@@ -15,7 +15,7 @@
| Author: Rasmus Lerdorf [EMAIL PROTECTED]|
+--+
  */
-/* $Id: head.c,v 1.80 2005/07/08 12:39:51 tony2001 Exp $ */
+/* $Id: head.c,v 1.81 2005/07/08 16:06:05 iliaa Exp $ */
 
 #include stdio.h
 #include php.h
@@ -64,7 +64,6 @@
 {
char *cookie, *encoded_value = NULL;
int len=sizeof(Set-Cookie: );
-   time_t t;
char *dt;
sapi_header_line ctr = {0};
int result;
@@ -103,7 +102,7 @@
 * so in order to force cookies to be deleted, even on MSIE, we
 * pick an expiry date 1 year and 1 second in the past
 */
-   t = time(NULL) - 31536001;
+   time_t t = time(NULL) - 31536001;
dt = php_format_date(D, d-M-Y H:i:s T, sizeof(D, d-M-Y H:i:s 
T)-1, t, 0);
sprintf(cookie, Set-Cookie: %s=deleted; expires=%s, name, dt);
efree(dt);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard head.c

2005-07-08 Thread Ilia Alshanetsky
iliaa   Fri Jul  8 12:17:06 2005 EDT

  Modified files:  
/php-src/ext/standard   head.c 
  Log:
  Missing bit of the previous patch.
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/head.c?r1=1.81r2=1.82ty=u
Index: php-src/ext/standard/head.c
diff -u php-src/ext/standard/head.c:1.81 php-src/ext/standard/head.c:1.82
--- php-src/ext/standard/head.c:1.81Fri Jul  8 12:06:05 2005
+++ php-src/ext/standard/head.c Fri Jul  8 12:17:04 2005
@@ -15,7 +15,7 @@
| Author: Rasmus Lerdorf [EMAIL PROTECTED]|
+--+
  */
-/* $Id: head.c,v 1.81 2005/07/08 16:06:05 iliaa Exp $ */
+/* $Id: head.c,v 1.82 2005/07/08 16:17:04 iliaa Exp $ */
 
 #include stdio.h
 #include php.h
@@ -110,7 +110,7 @@
sprintf(cookie, Set-Cookie: %s=%s, name, value ? 
encoded_value : );
if (expires  0) {
strcat(cookie, ; expires=);
-   dt = php_format_date(D, d-M-Y H:i:s T, sizeof(D, 
d-M-Y H:i:s T)-1, t, 0);
+   dt = php_format_date(D, d-M-Y H:i:s T, sizeof(D, 
d-M-Y H:i:s T)-1, expires, 0);
strcat(cookie, dt);
efree(dt);
}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard head.c

2004-09-25 Thread Anantha Kesari H Y
hyanantha   Sat Sep 25 11:33:57 2004 EDT

  Modified files:  
/php-src/ext/standard   head.c 
  Log:
  removing unwanted inclusion of socket header file
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/head.c?r1=1.76r2=1.77ty=u
Index: php-src/ext/standard/head.c
diff -u php-src/ext/standard/head.c:1.76 php-src/ext/standard/head.c:1.77
--- php-src/ext/standard/head.c:1.76Mon Aug 23 12:58:11 2004
+++ php-src/ext/standard/head.c Sat Sep 25 11:33:57 2004
@@ -15,14 +15,9 @@
| Author: Rasmus Lerdorf [EMAIL PROTECTED]|
+--+
  */
-/* $Id: head.c,v 1.76 2004/08/23 16:58:11 iliaa Exp $ */
+/* $Id: head.c,v 1.77 2004/09/25 15:33:57 hyanantha Exp $ */
 
 #include stdio.h
-
-#if defined(NETWARE)  !defined(NEW_LIBC)
-#include sys/socket.h
-#endif
-
 #include php.h
 #include ext/standard/php_standard.h
 #include SAPI.h

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard head.c

2004-08-23 Thread Ilia Alshanetsky
iliaa   Mon Aug 23 12:58:11 2004 EDT

  Modified files:  
/php-src/ext/standard   head.c 
  Log:
  Fixed proto of headers_list().
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/head.c?r1=1.75r2=1.76ty=u
Index: php-src/ext/standard/head.c
diff -u php-src/ext/standard/head.c:1.75 php-src/ext/standard/head.c:1.76
--- php-src/ext/standard/head.c:1.75Wed Feb 11 14:00:42 2004
+++ php-src/ext/standard/head.c Mon Aug 23 12:58:11 2004
@@ -15,7 +15,7 @@
| Author: Rasmus Lerdorf [EMAIL PROTECTED]|
+--+
  */
-/* $Id: head.c,v 1.75 2004/02/11 19:00:42 bfrance Exp $ */
+/* $Id: head.c,v 1.76 2004/08/23 16:58:11 iliaa Exp $ */
 
 #include stdio.h
 
@@ -244,7 +244,7 @@
}
 }
 
-/* {{{ proto string headers_list(void)
+/* {{{ proto array headers_list(void)
Return list of headers to be sent / already sent */
 PHP_FUNCTION(headers_list)
 {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard head.c

2004-02-11 Thread Brian France
bfrance Wed Feb 11 14:00:44 2004 EDT

  Modified files:  
/php-src/ext/standard   head.c 
  Log:
  
Added checks for invalid characters in a cookie name or cookie data from 
setrawcookie
  
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/head.c?r1=1.74r2=1.75ty=u
Index: php-src/ext/standard/head.c
diff -u php-src/ext/standard/head.c:1.74 php-src/ext/standard/head.c:1.75
--- php-src/ext/standard/head.c:1.74Thu Jan  8 03:17:32 2004
+++ php-src/ext/standard/head.c Wed Feb 11 14:00:42 2004
@@ -15,7 +15,7 @@
| Author: Rasmus Lerdorf [EMAIL PROTECTED]|
+--+
  */
-/* $Id: head.c,v 1.74 2004/01/08 08:17:32 andi Exp $ */
+/* $Id: head.c,v 1.75 2004/02/11 19:00:42 bfrance Exp $ */
 
 #include stdio.h
 
@@ -74,6 +74,16 @@
sapi_header_line ctr = {0};
int result;

+   if (name  strpbrk(name, =,; \t\r\n\013\014) != NULL) {   /* man isspace 
for \013 and \014 */
+   zend_error( E_WARNING, Cookie names can not contain any of the 
folllowing '=,; \\t\\r\\n\\013\\014' (%s), name );
+   return FAILURE;
+   }
+
+   if (!url_encode  value  strpbrk(value, ,; \t\r\n\013\014) != NULL) { /* 
man isspace for \013 and \014 */
+   zend_error( E_WARNING, Cookie values can not contain any of the 
folllowing ',; \\t\\r\\n\\013\\014' (%s), value );
+   return FAILURE;
+   }
+
len += name_len;
if (value  url_encode) {
int encoded_value_len;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard head.c

2003-11-20 Thread Andi Gutmans
andiThu Nov 20 04:14:51 2003 EDT

  Modified files:  
/php-src/ext/standard   head.c 
  Log:
  - Fix Windows build
  
  
Index: php-src/ext/standard/head.c
diff -u php-src/ext/standard/head.c:1.72 php-src/ext/standard/head.c:1.73
--- php-src/ext/standard/head.c:1.72Wed Nov 19 16:10:29 2003
+++ php-src/ext/standard/head.c Thu Nov 20 04:14:51 2003
@@ -15,7 +15,7 @@
| Author: Rasmus Lerdorf [EMAIL PROTECTED]|
+--+
  */
-/* $Id: head.c,v 1.72 2003/11/19 21:10:29 pollita Exp $ */
+/* $Id: head.c,v 1.73 2003/11/20 09:14:51 andi Exp $ */
 
 #include stdio.h
 
@@ -246,7 +246,7 @@
RETURN_FALSE;
}
array_init(return_value);
-   zend_llist_apply_with_argument(SG(sapi_headers).headers, 
php_head_apply_header_list_to_hash, return_value);
+   zend_llist_apply_with_argument(SG(sapi_headers).headers, 
php_head_apply_header_list_to_hash, return_value TSRMLS_CC);
 }
 /* }}} */
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php