| modification, are permitted provided that the conditions mentioned |
| in the accompanying LICENSE file are met. |
+--------------------------------------------------------------------+
- | Copyright (c) 2004-2006, Michael Wallner <mike@php.net> |
+ | Copyright (c) 2004-2007, Michael Wallner <mike@php.net> |
+--------------------------------------------------------------------+
*/
while (*++ptr && !HTTP_IS_CTYPE(digit, *ptr) && '.' != *ptr);
- quality = atof(ptr);
+ quality = zend_strtod(ptr, NULL);
identifier = estrndup(Z_STRVAL_PP(entry), ident_len = separator - Z_STRVAL_PP(entry));
} else {
quality = 1000.0 - i++;
switch (begin) {
/* "0-12345" */
case -10:
- /* "0-" */
- if (end == -1) {
- return RANGE_NO;
- }
- /* "0-0" or overflow */
- if (end == -10 || length <= (size_t) end) {
- return RANGE_ERR;
+ switch (end) {
+ /* "0-" */
+ case -1:
+ return RANGE_NO;
+
+ /* "0-0" */
+ case -10:
+ end = 0;
+ break;
+
+ default:
+ if (length <= (size_t) end) {
+ return RANGE_ERR;
+ }
+ break;
}
begin = 0;
break;
http_get_request_headers(NULL);
name = pretty_key(estrndup(header, name_len), name_len, 1, 1);
if (SUCCESS == zend_hash_find(HTTP_G->request.headers, name, name_len+1, (void *) &data)) {
- zvalue = zval_copy(IS_STRING, *data);
+ zvalue = *data;
+ convert_to_string_ex(&zvalue);
result = (match_case ? strcmp(Z_STRVAL_P(zvalue), value) : strcasecmp(Z_STRVAL_P(zvalue), value)) ? 0 : 1;
- zval_free(&zvalue);
+ if (zvalue != *data) {
+ zval_ptr_dtor(&zvalue);
+ }
}
efree(name);