From 9c3a3758396f2b1e5f0bf8fdc5a211b9c3689f49 Mon Sep 17 00:00:00 2001 From: MDW Date: Sun, 3 Mar 2024 16:56:12 +0100 Subject: [PATCH] Fix: Use accessible temporarypath for CMailFileTest (#28599) # Fix: Use accessible temporarypath for CMailFileTest '/tmp' does not exist on all systems and is subject to open_basedir restrictions. Selected another temporary path for the test. --- test/phpunit/CMailFileTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/phpunit/CMailFileTest.php b/test/phpunit/CMailFileTest.php index d0b5d480a82..0cf5aa83216 100644 --- a/test/phpunit/CMailFileTest.php +++ b/test/phpunit/CMailFileTest.php @@ -155,8 +155,8 @@ class CMailFileTest extends CommonClassTest $msg .= '

From wikipedia

Red dot'; $msg .= ''; - - $localobject = new CMailFile('Test', 'test@test.com', 'from@from.com', $msg, array(), array(), array(), '', '', 0, -1, '', '', '', '', 'standard', '', '/tmp'); + $tmp_dir = $conf->admin->dir_temp.'/'.__FUNCTION__.getmypid().'_tmp'; + $localobject = new CMailFile('Test', 'test@test.com', 'from@from.com', $msg, array(), array(), array(), '', '', 0, -1, '', '', '', '', 'standard', '', $tmp_dir); $result = count($localobject->html_images); print __METHOD__ . " result count image detected in the mail=" . $result . "\n";