Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit aa47864

Browse filesBrowse files
committed
[Filesystem] Safeguard (sym)link calls
1 parent 1a7fa5d commit aa47864
Copy full SHA for aa47864

File tree

1 file changed

+2
-2
lines changed
Filter options

1 file changed

+2
-2
lines changed

‎src/Symfony/Component/Filesystem/Filesystem.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Filesystem/Filesystem.php
+2-2Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.