From 9ee9c0e6748157198d0180920454bc203ee439a5 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Thu, 26 Sep 2024 09:53:58 +0200 Subject: [PATCH] Sync exif dependency on mbstring extension as optional (#16062) When decoding multibyte data in EXIF tags, the mbstring extension needs to be enabled. In Autotools this is now synced with ZEND_MOD_OPTIONAL in the C code, and on Windows it is now also optional. The required dependency on mbstring extension was removed via 755c2cd0d85b65f35abb2d54204fa7d38b820268 which made the mbstring extension optional dependency. --- ext/exif/config.m4 | 1 + ext/exif/config.w32 | 12 ++++-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/ext/exif/config.m4 b/ext/exif/config.m4 index 5d096cb4c16..6824ba2c345 100644 --- a/ext/exif/config.m4 +++ b/ext/exif/config.m4 @@ -10,4 +10,5 @@ if test "$PHP_EXIF" != "no"; then [exif.c], [$ext_shared],, [-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1]) + PHP_ADD_EXTENSION_DEP(exif, mbstring, true) fi diff --git a/ext/exif/config.w32 b/ext/exif/config.w32 index 52adaef5b12..81b9dd818f4 100644 --- a/ext/exif/config.w32 +++ b/ext/exif/config.w32 @@ -2,12 +2,8 @@ ARG_ENABLE('exif', 'Exchangeable image information (EXIF) Support', 'no'); -if(PHP_EXIF != 'no') -{ - if(ADD_EXTENSION_DEP('exif', 'mbstring')) - { - AC_DEFINE('HAVE_EXIF', 1, "Define to 1 if the PHP extension 'exif' is available."); - - EXTENSION('exif', 'exif.c', null, '/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1'); - } +if(PHP_EXIF != 'no') { + AC_DEFINE('HAVE_EXIF', 1, "Define to 1 if the PHP extension 'exif' is available."); + EXTENSION('exif', 'exif.c', null, '/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1'); + ADD_EXTENSION_DEP('exif', 'mbstring', true); }