Fixed bug preventing deletion of custom background image

https://github.com/LinkStackOrg/LinkStack/issues/495
This commit is contained in:
Julian Prieber 2023-07-19 13:42:13 +02:00
parent 584c09fc89
commit 47f9ce4a01
1 changed files with 0 additions and 11 deletions

View File

@ -776,17 +776,6 @@ class UserController extends Controller
public function removeBackground()
{
function findBackground($name){
$directory = base_path('assets/img/background-img/');
$files = scandir($directory);
$pathinfo = "error.error";
foreach($files as $file) {
if (strpos($file, $name.'.') !== false) {
$pathinfo = $name. "." . pathinfo($file, PATHINFO_EXTENSION);
}}
return $pathinfo;
}
$user_id = Auth::user()->id;
$path = findBackground($user_id);
$path = base_path('assets/img/background-img/'.$path);