| modification, are permitted provided that the conditions mentioned |
| in the accompanying LICENSE file are met. |
+--------------------------------------------------------------------+
| modification, are permitted provided that the conditions mentioned |
| in the accompanying LICENSE file are met. |
+--------------------------------------------------------------------+
-/* {{{ */
-PHP_MINIT_FUNCTION(http_headers)
-{
- HTTP_LONG_CONSTANT("HTTP_REDIRECT", HTTP_REDIRECT);
- HTTP_LONG_CONSTANT("HTTP_REDIRECT_PERM", HTTP_REDIRECT_PERM);
- HTTP_LONG_CONSTANT("HTTP_REDIRECT_POST", HTTP_REDIRECT_POST);
- HTTP_LONG_CONSTANT("HTTP_REDIRECT_TEMP", HTTP_REDIRECT_TEMP);
-
- return SUCCESS;
-}
-/* }}} */
-
/* {{{ static int http_sort_q(const void *, const void *) */
static int http_sort_q(const void *a, const void *b TSRMLS_DC)
{
/* {{{ static int http_sort_q(const void *, const void *) */
static int http_sort_q(const void *a, const void *b TSRMLS_DC)
{
FOREACH_HASH_VAL(pos, supported, value) {
int len = dash_test - test;
#if HTTP_DBG_NEG
FOREACH_HASH_VAL(pos, supported, value) {
int len = dash_test - test;
#if HTTP_DBG_NEG
- fprintf(stderr, "strncascmp('%s', '%s', %d)\n", Z_STRVAL_PP(value), test, len);
+ fprintf(stderr, "strncasecmp('%s', '%s', %d)\n", Z_STRVAL_PP(value), test, len);
#endif
if ( (!strncasecmp(Z_STRVAL_PP(value), test, len)) &&
( (Z_STRVAL_PP(value)[len] == '\0') ||
#endif
if ( (!strncasecmp(Z_STRVAL_PP(value), test, len)) &&
( (Z_STRVAL_PP(value)[len] == '\0') ||
if ((separator = strchr(Z_STRVAL_PP(entry), ';'))) {
const char *ptr = separator;
if ((separator = strchr(Z_STRVAL_PP(entry), ';'))) {
const char *ptr = separator;
- identifier = estrndup(Z_STRVAL_PP(entry), Z_STRLEN_PP(entry));
+ identifier = estrndup(Z_STRVAL_PP(entry), ident_len = Z_STRLEN_PP(entry));
+ }
+ freeme = identifier;
+
+ while (isspace(*identifier)) {
+ ++identifier;
+ --ident_len;
+ }
+ while (ident_len && isspace(identifier[ident_len - 1])) {
+ identifier[--ident_len] = '\0';
if (SUCCESS == zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **) &hsv)) {
FOREACH_KEYLEN(pos, *hsv, key, keylen, idx) {
if (key && keylen > 6 && !strncmp(key, "HTTP_", 5)) {
if (SUCCESS == zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **) &hsv)) {
FOREACH_KEYLEN(pos, *hsv, key, keylen, idx) {
if (key && keylen > 6 && !strncmp(key, "HTTP_", 5)) {