From f0d621e1011c05d75a043b48c0635fbca312b449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Anne?= Date: Wed, 27 Oct 2021 09:39:15 +0200 Subject: [PATCH] Prevent uncaught exception when iconv/mbstring are missing; fixes #10168 (#10224) --- bin/composer | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/composer b/bin/composer index 62c18974d..cee476b6d 100755 --- a/bin/composer +++ b/bin/composer @@ -24,6 +24,12 @@ if (defined('HHVM_VERSION') && version_compare(HHVM_VERSION, '4.0', '>=')) { echo 'HHVM 4.0 has dropped support for Composer, please use PHP instead. Aborting.'.PHP_EOL; exit(1); } +if (!extension_loaded('iconv') && !extension_loaded('mbstring')) { + echo 'The iconv OR mbstring extension is required and both are missing.' + .PHP_EOL.'Install either of them or recompile php without --disable-iconv.' + .PHP_EOL.'Aborting.'.PHP_EOL; + exit(1); +} if (function_exists('ini_set')) { @ini_set('display_errors', '1');