Skip to content

Commit

Permalink
Refactor string assembly to use the path join function
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Apr 29, 2024
1 parent 9b16ffe commit 2872b8e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/framework/src/Foundation/Kernel/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ public function mediaPath(string $path = ''): string
return $this->path(Hyde::getMediaDirectory());
}

$path = unslash($path);

return $this->path(Hyde::getMediaDirectory()."/$path");
return $this->path(path_join(Hyde::getMediaDirectory(), unslash($path)));
}

/**
Expand All @@ -113,9 +111,7 @@ public function sitePath(string $path = ''): string
return $this->path(Hyde::getOutputDirectory());
}

$path = unslash($path);

return $this->path(Hyde::getOutputDirectory()."/$path");
return $this->path(path_join(Hyde::getOutputDirectory(), unslash($path)));
}

/**
Expand Down

0 comments on commit 2872b8e

Please sign in to comment.