From f5265fa95627298ba3b281b0f59f2831c1b4ced1 Mon Sep 17 00:00:00 2001 From: Christian Leucht Date: Fri, 20 Feb 2026 11:33:04 +0100 Subject: [PATCH 1/2] Add check for symlink function existence Check if symlink function exists before proceeding. Signed-off-by: Christian Leucht --- inc/functions.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/inc/functions.php b/inc/functions.php index 6db43ea..d5592b5 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -53,7 +53,11 @@ function withAssetSuffix(string $file): string */ function symlinkedAssetFolder(string $originDir, string $name): ?string { - // we're using realpath here, otherwise the comparisment with + if(!function_exists('symlink')) { + return null; + } + + // we're using realpath here, otherwise the comparison with // readlink will not work. $originDir = realpath($originDir); From 27cce65a3a278994501a674bea41cc9628324a4a Mon Sep 17 00:00:00 2001 From: Christian Leucht Date: Fri, 20 Feb 2026 11:54:18 +0100 Subject: [PATCH 2/2] Check for symlink function after unlinking Signed-off-by: Christian Leucht --- inc/functions.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index d5592b5..fe77ca2 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -53,10 +53,6 @@ function withAssetSuffix(string $file): string */ function symlinkedAssetFolder(string $originDir, string $name): ?string { - if(!function_exists('symlink')) { - return null; - } - // we're using realpath here, otherwise the comparison with // readlink will not work. $originDir = realpath($originDir); @@ -78,6 +74,10 @@ function symlinkedAssetFolder(string $originDir, string $name): ?string unlink($targetDir); } + if(!function_exists('symlink')) { + return null; + } + if (!symlink($originDir, $targetDir)) { return null; }