8000 [Filesystem] Safeguard (sym)link calls · symfony/symfony@67df83c · GitHub
[go: up one dir, main page]

Skip to content

Commit 67df83c

Browse files
committed
[Filesystem] Safeguard (sym)link calls
1 parent 1a7fa5d commit 67df83c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Filesystem/Filesystem.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ public function symlink($originDir, $targetDir, $copyOnWindows = false)
338338
$this->remove($targetDir);
339339
}
340340

341-
if (!self::box('symlink', $originDir, $targetDir)) {
341+
if (!\function_exists('symlink') || !self::box('symlink', $originDir, $targetDir)) {
342342
$this->linkException($originDir, $targetDir, 'symbolic');
343343
}
344344
}
@@ -370,7 +370,7 @@ public function hardlink($originFile, $targetFiles)
370370
$this->remove($targetFile);
371371
}
372372

373-
if (!self::box('link', $originFile, $targetFile)) {
373+
if (!\function_exists('link') || !self::box('link', $originFile, $targetFile)) {
374374
$this->linkException($originFile, $targetFile, 'hard');
375375
}
376376
}

0 commit comments

Comments
 (0)
0