mirror of
https://github.com/php/php-src.git
synced 2025-08-16 14:08:47 +02:00
Some encodings were assumed to be default and, thus, were not made
persistent.
This commit is contained in:
parent
7330c32329
commit
cfaf6406d7
3 changed files with 9 additions and 5 deletions
|
@ -211,6 +211,9 @@ encode defaultEncoding[] = {
|
||||||
{{END_KNOWN_TYPES, NULL, NULL, NULL}, guess_zval_convert, guess_xml_convert}
|
{{END_KNOWN_TYPES, NULL, NULL, NULL}, guess_zval_convert, guess_xml_convert}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
int numDefaultEncodings = sizeof(defaultEncoding)/sizeof(encode);
|
||||||
|
|
||||||
|
|
||||||
void whiteSpace_replace(char* str)
|
void whiteSpace_replace(char* str)
|
||||||
{
|
{
|
||||||
while (*str != '\0') {
|
while (*str != '\0') {
|
||||||
|
|
|
@ -222,5 +222,6 @@ void delete_encoder(void *handle);
|
||||||
void delete_encoder_persistent(void *handle);
|
void delete_encoder_persistent(void *handle);
|
||||||
|
|
||||||
extern encode defaultEncoding[];
|
extern encode defaultEncoding[];
|
||||||
|
extern int numDefaultEncodings;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -2292,7 +2292,7 @@ static void make_persistent_sdl_type_ref(sdlTypePtr *type, HashTable *ptr_map, H
|
||||||
{
|
{
|
||||||
sdlTypePtr *tmp;
|
sdlTypePtr *tmp;
|
||||||
|
|
||||||
if (zend_hash_find(ptr_map, (char *)(*type), sizeof(sdlTypePtr), (void**)&tmp) == SUCCESS) {
|
if (zend_hash_find(ptr_map, (char *)type, sizeof(sdlTypePtr), (void**)&tmp) == SUCCESS) {
|
||||||
*type = *tmp;
|
*type = *tmp;
|
||||||
} else {
|
} else {
|
||||||
zend_hash_next_index_insert(bp_types, (void*)&type, sizeof(sdlTypePtr*), NULL);
|
zend_hash_next_index_insert(bp_types, (void*)&type, sizeof(sdlTypePtr*), NULL);
|
||||||
|
@ -2305,11 +2305,11 @@ static void make_persistent_sdl_encoder_ref(encodePtr *enc, HashTable *ptr_map,
|
||||||
encodePtr *tmp;
|
encodePtr *tmp;
|
||||||
|
|
||||||
/* do not process defaultEncoding's here */
|
/* do not process defaultEncoding's here */
|
||||||
if ((*enc)->details.sdl_type == NULL) {
|
if ((*enc) >= defaultEncoding && (*enc) < defaultEncoding + numDefaultEncodings) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (zend_hash_find(ptr_map, (char *)(*enc), sizeof(encodePtr), (void**)&tmp) == SUCCESS) {
|
if (zend_hash_find(ptr_map, (char *)enc, sizeof(encodePtr), (void**)&tmp) == SUCCESS) {
|
||||||
*enc = *tmp;
|
*enc = *tmp;
|
||||||
} else {
|
} else {
|
||||||
zend_hash_next_index_insert(bp_encoders, (void*)&enc, sizeof(encodePtr*), NULL);
|
zend_hash_next_index_insert(bp_encoders, (void*)&enc, sizeof(encodePtr*), NULL);
|
||||||
|
@ -2513,7 +2513,7 @@ static sdlAttributePtr make_persistent_sdl_attribute(sdlAttributePtr attr, HashT
|
||||||
}
|
}
|
||||||
|
|
||||||
/* we do not want to process defaultEncoding's here */
|
/* we do not want to process defaultEncoding's here */
|
||||||
if (pattr->encode && pattr->encode->details.sdl_type) {
|
if (pattr->encode) {
|
||||||
make_persistent_sdl_encoder_ref(&pattr->encode, ptr_map, bp_encoders);
|
make_persistent_sdl_encoder_ref(&pattr->encode, ptr_map, bp_encoders);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2625,7 +2625,7 @@ static sdlTypePtr make_persistent_sdl_type(sdlTypePtr type, HashTable *ptr_map,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* we do not want to process defaultEncoding's here */
|
/* we do not want to process defaultEncoding's here */
|
||||||
if (ptype->encode && ptype->encode->details.sdl_type) {
|
if (ptype->encode) {
|
||||||
make_persistent_sdl_encoder_ref(&ptype->encode, ptr_map, bp_encoders);
|
make_persistent_sdl_encoder_ref(&ptype->encode, ptr_map, bp_encoders);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue