Skip to content

Commit

Permalink
fix: path segmentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lapdx committed Apr 29, 2020
1 parent 2f5f581 commit 843869e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Controllers/APIController.php
Expand Up @@ -280,6 +280,10 @@ private function uploadBase64($file, $customDirectoryPath, $directoryPath, $cust
if ($customDirectoryPath) {
$fullRelativePath = "/" . $customDirectoryPath . '/' . $newFileName;
}
preg_match('/\/$/', $directoryPath,$matches);
if (empty($matches)) {
$directoryPath = $directoryPath . '/';
}
$isSuccess = file_put_contents($directoryPath.$fullRelativePath, $image);
if ($isSuccess) {
$retVal = $fullRelativePath;
Expand Down

0 comments on commit 843869e

Please sign in to comment.