diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 6d8a8a048d3..2c23f6e0475 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -2803,7 +2803,11 @@ class EmailCollector extends CommonObject // TODO Move mail using PHP-IMAP } } else { - dol_syslog("EmailCollector::doCollectOneCollector message ".$imapemail." to ".$connectstringtarget." was set to read", LOG_DEBUG); + if (empty($conf->global->MAIN_IMAP_USE_PHPIMAP)) { + dol_syslog("EmailCollector::doCollectOneCollector message ".((string) $imapemail)." to ".$connectstringtarget." was set to read", LOG_DEBUG); + } else { + dol_syslog("EmailCollector::doCollectOneCollector message '".($imapemail->getHeader()->get('subject'))."' using this->host=".$this->host.", this->access_type=".$this->acces_type." was set to read", LOG_DEBUG); + } } } else { $errorforemail++; diff --git a/htdocs/includes/webklex/php-imap/vendor/autoload.php b/htdocs/includes/webklex/php-imap/vendor/autoload.php index f4e36963c6a..298bedf9b9c 100644 --- a/htdocs/includes/webklex/php-imap/vendor/autoload.php +++ b/htdocs/includes/webklex/php-imap/vendor/autoload.php @@ -13,10 +13,23 @@ require_once __DIR__ . '/composer/autoload_real.php'; return ComposerAutoloaderInit4da13270269c89a28e472e1f7324e6d1::getLoader(); */ + +// Add class/method of PHP8 for compatibility with older versions of PHP +require_once(__DIR__.'/symfony/polyfill-php80/bootstrap.php'); + + spl_autoload_register(function ($class_name) { // Enable this to detect what we need for require_once //var_dump($class_name); + + $preg_match = preg_match('/^Symfony\\\Polyfill\\\Php80\\\/', $class_name); + if (1 === $preg_match) { + $class_name = preg_replace('/\\\/', '/', $class_name); + $class_name = preg_replace('/^Symfony\\/Polyfill\\/Php80\\//', '', $class_name); + require_once __DIR__ . '/symfony/polyfill-php80/' . $class_name . '.php'; + } + $preg_match = preg_match('/^Webklex\\\PHPIMAP\\\/', $class_name); if (1 === $preg_match) { $class_name = preg_replace('/\\\/', '/', $class_name);