]> granicus.if.org Git - php/commitdiff
- Sync with 5_3
authorFelipe Pena <felipe@php.net>
Fri, 12 Jun 2009 14:00:10 +0000 (14:00 +0000)
committerFelipe Pena <felipe@php.net>
Fri, 12 Jun 2009 14:00:10 +0000 (14:00 +0000)
ext/exif/exif.c

index 35746d5b425e82c4006d0e00143851a083bd18ca..dd6527a4d67fe1f2ffc8ce6d9ffe0493c250ab64 100644 (file)
@@ -3888,24 +3888,25 @@ static int exif_read_file(image_info_type *ImageInfo, char *FileName, int read_t
 PHP_FUNCTION(exif_read_data)
 {
        zval **p_name;
-       int i, ret, sections_needed=0;
+       int i, ret, sections_needed=0, p_sections_needed_len;
        zend_bool sub_arrays=0, read_thumbnail=0, read_all=0;
        image_info_type ImageInfo;
-       char tmp[64], *sections_str=0, *s;
+       char tmp[64], *sections_str = NULL, *p_sections_needed = NULL, *s;
        char *filename;
        int filename_len, sections_str_len = 0;
 
-       memset(&ImageInfo, 0, sizeof(ImageInfo));
-
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|sbb", &p_name, &sections_str, &sections_str_len, &sub_arrays, &read_thumbnail) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|sbb", &p_name, &p_sections_needed, &p_sections_needed_len, &sub_arrays, &read_thumbnail) == FAILURE) {
                return;
        }
 
        if (php_stream_path_param_encode(p_name, &filename, &filename_len, REPORT_ERRORS, FG(default_context)) == FAILURE) {
                return;
        }
+       
+       memset(&ImageInfo, 0, sizeof(ImageInfo));
 
-       if (sections_needed) {
+       if (p_sections_needed) {
+               spprintf(&sections_str, 0, ",%s,", p_sections_needed);
                /* sections_str DOES start with , and SPACES are NOT allowed in names */
                s = sections_str;
                while(*++s) {