--- /dev/null
+--- exif.c 2006/10/10 22:22:43 1.173.2.5.2.4
++++ exif.c 2007/01/09 17:55:29 1.173.2.5.2.10
+@@ -2,7 +2,7 @@
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+- | Copyright (c) 1997-2006 The PHP Group |
++ | Copyright (c) 1997-2007 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+@@ -17,7 +17,7 @@
+ +----------------------------------------------------------------------+
+ */
+
+-/* $Id$ */
++/* $Id$ */
+
+ /* ToDos
+ *
+@@ -139,7 +139,7 @@
+ };
+ /* }}} */
+
+-#define EXIF_VERSION "1.4 $Id$"
++#define EXIF_VERSION "1.4 $Id$"
+
+ /* {{{ PHP_MINFO_FUNCTION
+ */
+@@ -1150,6 +1150,80 @@
+ }
+ /* }}} */
+
++#ifdef EXIF_DEBUG
++char * exif_dump_data(int *dump_free, int format, int components, int length, int motorola_intel, char *value_ptr TSRMLS_DC) /* {{{ */
++{
++ char *dump;
++ int len;
++
++ *dump_free = 0;
++ if (format == TAG_FMT_STRING) {
++ return value_ptr ? value_ptr : "<no data>";
++ }
++ if (format == TAG_FMT_UNDEFINED) {
++ return "<undefined>\n";
++ }
++ if (format == TAG_FMT_IFD) {
++ return "";
++ }
++ if (format == TAG_FMT_SINGLE || format == TAG_FMT_DOUBLE) {
++ return "<not implemented>";
++ }
++ *dump_free = 1;
++ if (components > 1) {
++ len = spprintf(&dump, 0, "(%d,%d) {", components, length);
++ } else {
++ len = spprintf(&dump, 0, "{");
++ }
++ while(components > 0) {
++ switch(format) {
++ case TAG_FMT_BYTE:
++ case TAG_FMT_UNDEFINED:
++ case TAG_FMT_STRING:
++ case TAG_FMT_SBYTE:
++ dump = erealloc(dump, len + 4);
++ sprintf(dump + len, "0x%02X", *value_ptr);
++ len += 4;
++ value_ptr++;
++ break;
++ case TAG_FMT_USHORT:
++ case TAG_FMT_SSHORT:
++ dump = erealloc(dump, len + 6);
++ sprintf(dump + len, "0x%04X", php_ifd_get16s(value_ptr, motorola_intel));
++ len += 6;
++ value_ptr += 2;
++ break;
++ case TAG_FMT_ULONG:
++ case TAG_FMT_SLONG:
++ dump = erealloc(dump, len + 6);
++ sprintf(dump + len, "0x%04X", php_ifd_get32s(value_ptr, motorola_intel));
++ len += 6;
++ value_ptr += 4;
++ break;
++ case TAG_FMT_URATIONAL:
++ case TAG_FMT_SRATIONAL:
++ dump = erealloc(dump, len + 13);
++ sprintf(dump + len, "0x%04X/0x%04X", php_ifd_get32s(value_ptr, motorola_intel), php_ifd_get32s(value_ptr+4, motorola_intel));
++ len += 13;
++ value_ptr += 8;
++ break;
++ }
++ if (components > 0) {
++ dump = erealloc(dump, len + 2);
++ sprintf(dump + len, ", ");
++ len += 2;
++ components--;
++ } else{
++ break;
++ }
++ }
++ dump = erealloc(dump, len + 2);
++ sprintf(dump + len, "}");
++ return dump;
++}
++/* }}} */
++#endif
++
+ /* {{{ exif_convert_any_format
+ * Evaluate number, be it int, rational, or float from directory. */
+ static double exif_convert_any_format(void *value, int format, int motorola_intel TSRMLS_DC)
+@@ -1599,6 +1673,7 @@
+ image_info->info_list[section_index].list = list;
+
+ info_data = &image_info->info_list[section_index].list[image_info->info_list[section_index].count];
++ memset(info_data, 0, sizeof(image_info_data));
+ info_data->tag = tag;
+ info_data->format = format;
+ info_data->length = length;
+@@ -2746,10 +2821,14 @@
+ char *value_ptr, tagname[64], cbuf[32], *outside=NULL;
+ size_t byte_count, offset_val, fpos, fgot;
+ xp_field_type *tmp_xp;
++#ifdef EXIF_DEBUG
++ char *dump_data;
++ int dump_free;
++#endif /* EXIF_DEBUG */
+
+ /* Protect against corrupt headers */
+ if (ImageInfo->ifd_nesting_level > MAX_IFD_NESTING_LEVEL) {
+- exif_error_docref("exif_read_data#error_ifd" TSRMLS_CC, ImageInfo, E_WARNING, "corrupt EXIF header: maximum directory nesting level reached");
++ exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "corrupt EXIF header: maximum directory nesting level reached");
+ return FALSE;
+ }
+ ImageInfo->ifd_nesting_level++;
+@@ -2834,7 +2913,11 @@
+
+ ImageInfo->sections_found |= FOUND_ANY_TAG;
+ #ifdef EXIF_DEBUG
+- exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process tag(x%04X=%s,@x%04X + x%04X(=%d)): %s%s", tag, exif_get_tagname(tag, tagname, -12, tag_table TSRMLS_CC), offset_val+displacement, byte_count, byte_count, (components>1)&&format!=TAG_FMT_UNDEFINED&&format!=TAG_FMT_STRING?"ARRAY OF ":"", format==TAG_FMT_STRING?(value_ptr?value_ptr:"<no data>"):exif_get_tagformat(format));
++ dump_data = exif_dump_data(&dump_free, format, components, length, ImageInfo->motorola_intel, value_ptr TSRMLS_CC);
++ exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process tag(x%04X=%s,@x%04X + x%04X(=%d)): %s%s %s", tag, exif_get_tagname(tag, tagname, -12, tag_table TSRMLS_CC), offset_val+displacement, byte_count, byte_count, (components>1)&&format!=TAG_FMT_UNDEFINED&&format!=TAG_FMT_STRING?"ARRAY OF ":"", exif_get_tagformat(format), dump_data);
++ if (dump_free) {
++ efree(dump_data);
++ }
+ #endif
+ if (section_index==SECTION_THUMBNAIL) {
+ if (!ImageInfo->Thumbnail.data) {
+@@ -3023,7 +3106,9 @@
+ exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD Pointer");
+ return FALSE;
+ }
+- exif_process_IFD_in_JPEG(ImageInfo, Subdir_start, offset_base, IFDlength, displacement, sub_section_index TSRMLS_CC);
++ if (!exif_process_IFD_in_JPEG(ImageInfo, Subdir_start, offset_base, IFDlength, displacement, sub_section_index TSRMLS_CC)) {
++ return FALSE;
++ }
+ #ifdef EXIF_DEBUG
+ exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Subsection %s done", exif_get_sectionname(sub_section_index));
+ #endif
+@@ -3590,7 +3675,7 @@
+ exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "%s THUMBNAIL @0x%04X + 0x%04X", ImageInfo->Thumbnail.data ? "Ignore" : "Read", ImageInfo->Thumbnail.offset, ImageInfo->Thumbnail.size);
+ #endif
+ if (!ImageInfo->Thumbnail.data) {
+- ImageInfo->Thumbnail.data = emalloc(ImageInfo->Thumbnail.size);
++ ImageInfo->Thumbnail.data = safe_emalloc(ImageInfo->Thumbnail.size, 1, 0);
+ php_stream_seek(ImageInfo->infile, ImageInfo->Thumbnail.offset, SEEK_SET);
+ fgot = php_stream_read(ImageInfo->infile, ImageInfo->Thumbnail.data, ImageInfo->Thumbnail.size);
+ if (fgot < ImageInfo->Thumbnail.size) {
+@@ -3623,7 +3708,7 @@
+ exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "%s THUMBNAIL @0x%04X + 0x%04X", ImageInfo->Thumbnail.data ? "Ignore" : "Read", ImageInfo->Thumbnail.offset, ImageInfo->Thumbnail.size);
+ #endif
+ if (!ImageInfo->Thumbnail.data && ImageInfo->Thumbnail.offset && ImageInfo->Thumbnail.size && ImageInfo->read_thumbnail) {
+- ImageInfo->Thumbnail.data = emalloc(ImageInfo->Thumbnail.size);
++ ImageInfo->Thumbnail.data = safe_emalloc(ImageInfo->Thumbnail.size, 1, 0);
+ php_stream_seek(ImageInfo->infile, ImageInfo->Thumbnail.offset, SEEK_SET);
+ fgot = php_stream_read(ImageInfo->infile, ImageInfo->Thumbnail.data, ImageInfo->Thumbnail.size);
+ if (fgot < ImageInfo->Thumbnail.size) {
+@@ -3914,7 +3999,7 @@
+ exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "ByteOrderMotorola", ImageInfo.motorola_intel TSRMLS_CC);
+ }
+ if (ImageInfo.FocalLength) {
+- exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocalLength" TSRMLS_CC, "%4.1fmm", ImageInfo.FocalLength);
++ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocalLength" TSRMLS_CC, "%4.1Fmm", ImageInfo.FocalLength);
+ if(ImageInfo.CCDWidth) {
+ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "35mmFocalLength" TSRMLS_CC, "%dmm", (int)(ImageInfo.FocalLength/ImageInfo.CCDWidth*35+0.5));
+ }
+@@ -3924,19 +4009,19 @@
+ }
+ if(ImageInfo.ExposureTime>0) {
+ if(ImageInfo.ExposureTime <= 0.5) {
+- exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime" TSRMLS_CC, "%0.3f s (1/%d)", ImageInfo.ExposureTime, (int)(0.5 + 1/ImageInfo.ExposureTime));
++ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime" TSRMLS_CC, "%0.3F s (1/%d)", ImageInfo.ExposureTime, (int)(0.5 + 1/ImageInfo.ExposureTime));
+ } else {
+- exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime" TSRMLS_CC, "%0.3f s", ImageInfo.ExposureTime);
++ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime" TSRMLS_CC, "%0.3F s", ImageInfo.ExposureTime);
+ }
+ }
+ if(ImageInfo.ApertureFNumber) {
+- exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ApertureFNumber" TSRMLS_CC, "f/%.1f", ImageInfo.ApertureFNumber);
++ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ApertureFNumber" TSRMLS_CC, "f/%.1F", ImageInfo.ApertureFNumber);
+ }
+ if(ImageInfo.Distance) {
+ if(ImageInfo.Distance<0) {
+ exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "FocusDistance", "Infinite" TSRMLS_CC);
+ } else {
+- exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocusDistance" TSRMLS_CC, "%0.2fm", ImageInfo.Distance);
++ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocusDistance" TSRMLS_CC, "%0.2Fm", ImageInfo.Distance);
+ }
+ }
+ if (ImageInfo.UserComment) {
+@@ -4005,7 +4090,7 @@
+ Reads the embedded thumbnail */
+ PHP_FUNCTION(exif_thumbnail)
+ {
+- zval *p_width, *p_height, *p_imagetype;
++ zval *p_width = 0, *p_height = 0, *p_imagetype = 0;
+ char *p_name;
+ int p_name_len, ret, arg_c = ZEND_NUM_ARGS();
+ image_info_type ImageInfo;
# TODO:
-# - deal with modules removed from php and not moved to PECL
-# removed from php 5.2:
+# - deal with modules removed from php and not moved to PECL, still not obsoleted anywhere
+# - removed from php 5.0 (currently in php4):
+# db, hyperwave, java, mcal, overload, qtdom
+# - removed from php 5.1:
+# cpdf, fam, oracle
+# - removed from php 5.2:
# filepro, hw
# - mime_magic can't handle new "string/*" entries in magic.mime
# thus doesn't work with system magic.mime database
-# - make additional headers added by mail patch configurable
+# - make additional headers and checking added by mail patch configurable
# - apply -hardened patch by default ?
# - modularize session, standard (output from pure php -m)?
#
# Conditional build:
-%bcond_with db3 # use db3 packages instead of db (4.x) for Berkeley DB support
%bcond_with fdf # with FDF (PDF forms) module (BR: proprietary lib)
%bcond_with hardening # build with hardening patch applied (http://www.hardened-php.net/)
%bcond_with interbase_inst # use InterBase install., not Firebird (BR: proprietary libs)
%bcond_without curl # without CURL extension module
%bcond_without filter # without filter extension module
%bcond_without imap # without IMAP extension module
-%bcond_with interbase # with InterBase extension module
+%bcond_without interbase # without InterBase extension module
%bcond_without ldap # without LDAP extension module
%bcond_without mhash # without mhash extension module
%bcond_without mime_magic # without mime-magic module
%bcond_without apache2 # disable building apache 2.x module
%bcond_without fcgi # disable building FCGI SAPI
%bcond_without zts # disable experimental-zts
-%bcond_with versioning # build with experimental versioning (to load php4/php5 into same apache)
+%bcond_with versioning # build with experimental versioning (to load php4/php5 into same apache)
%define apxs1 /usr/sbin/apxs1
%define apxs2 /usr/sbin/apxs
%undefine with_filter
%endif
-%define _rel 4
+%define _rel 11
Summary: PHP: Hypertext Preprocessor
Summary(fr): Le langage de script embarque-HTML PHP
Summary(pl): Jêzyk skryptowy PHP
Patch10: %{name}-ini.patch
Patch11: %{name}-acam.patch
Patch12: %{name}-curl.patch
-Patch14: %{name}-allow-db31.patch
+Patch13: %{name}-bug-40073.patch
Patch15: %{name}-threads-acfix.patch
Patch16: %{name}-tsrmlsfetchgcc2.patch
Patch17: %{name}-no_pear_install.patch
BuildRequires: bzip2-devel
%{?with_curl:BuildRequires: curl-devel >= 7.12.0}
BuildRequires: cyrus-sasl-devel
-%{!?with_db3:BuildRequires: db-devel >= 4.0}
-%{?with_db3:BuildRequires: db3-devel >= 3.1}
+BuildRequires: db-devel >= 4.0
BuildRequires: elfutils-devel
%if %{with xmlrpc}
BuildRequires: expat-devel
Group: Libraries
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(hash)
+Obsoletes: php-pecl-hash
%description hash
Native implementations of common message digest algorithms using a
# conditionally...
%patch11 -p1
%patch12 -p1
-%patch14 -p1
+cd ext/exif
+%patch13 -p0
+cd ../../
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
-#%patch23 -p1 # UPDATE?
+#%patch23 -p1
%patch24 -p1
%patch26 -p1
--enable-xmlreader=shared \
--with-bz2=shared \
%{!?with_curl:--without-curl}%{?with_curl:--with-curl=shared} \
- %{?with_db3:--with-db3}%{!?with_db3:--with-db4} \
+ --with-db4 \
--enable-dbase=shared \
%if %{with xmlrpc}
--with-expat-dir=shared,/usr \
# isn't installed by install-headers make target, we do it manually here.
# this header file is required by e.g. filter PECL extension
install -D ext/pcre/php_pcre.h $RPM_BUILD_ROOT%{_includedir}/php/ext/pcre/php_pcre.h
+# for php-pecl-mailparse
+install -d $RPM_BUILD_ROOT%{_includedir}/php/ext/mbstring
+cp -a ext/mbstring/libmbfl/mbfl/*.h $RPM_BUILD_ROOT%{_includedir}/php/ext/mbstring
%clean
rm -rf $RPM_BUILD_ROOT