Skip to content

Commit

Permalink
- Fix build.
Browse files Browse the repository at this point in the history
  • Loading branch information
Moriyoshi Koizumi committed Dec 22, 2010
1 parent 9b698db commit e8b1590
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions ext/exif/exif.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,18 +166,30 @@ ZEND_DECLARE_MODULE_GLOBALS(exif)

ZEND_INI_MH(OnUpdateEncode)
{
if (new_value && strlen(new_value) && !zend_multibyte_check_encoding_list(new_value TSRMLS_CC)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal encoding ignored: '%s'", new_value);
return FAILURE;
if (new_value && new_value_length) {
const zend_encoding **return_list;
size_t return_size;
if (FAILURE == zend_multibyte_parse_encoding_list(new_value, new_value_length,
&return_list, &return_size, 0 TSRMLS_CC)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal encoding ignored: '%s'", new_value);
return FAILURE;
}
efree(return_list);
}
return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
}

ZEND_INI_MH(OnUpdateDecode)
{
if (!zend_multibyte_check_encoding_list(new_value TSRMLS_CC)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal encoding ignored: '%s'", new_value);
return FAILURE;
if (new_value) {
const zend_encoding **return_list;
size_t return_size;
if (FAILURE == zend_multibyte_parse_encoding_list(new_value, new_value_length,
&return_list, &return_size, 0 TSRMLS_CC)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal encoding ignored: '%s'", new_value);
return FAILURE;
}
efree(return_list);
}
return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
}
Expand Down

0 comments on commit e8b1590

Please sign in to comment.