has('advanced-config.expand_panel_admin_menu_permanently') and !config()->has('disable_default_password_notice')) { function getStringBetween($string, $start, $end) { $lastStartIndex = strrpos($string, $start); $lastEndIndex = strrpos($string, $end); $substringStartIndex = $lastStartIndex + strlen($start); $substringSize = $lastStartIndex - $lastEndIndex - 1; return substr($string, $substringStartIndex, $substringSize); } $subject = file_get_contents('config/advanced-config.php'); $search = ")"; $replace = "),"; file_put_contents('config/advanced-config.php', str_replace('),,', '),', strrev(implode(strrev($replace), explode(strrev($search), strrev($subject), 2))))); $replace = "];"; file_put_contents('config/advanced-config.php', str_replace($replace, file_get_contents('storage/templates/advanced-config-update-1.php'), file_get_contents('config/advanced-config.php'))); } if(EnvEditor::keyExists('FORCE_HTTPS')){ /* Do nothing if key already exists */ } else {EnvEditor::addKey('FORCE_HTTPS', 'false');} use App\Models\Page; $data['page'] = Page::select('contact')->first(); if (strpos($data['page']->contact, 'info@littlelink-custom.com') !== false) { $contact = '

LittleLink Custom is a free, open source link sharing platform. We depend on community feedback to steadily improve this project.

Feel free to send us your feedback!

If you're having any trouble or encountered a bug, feel free to open an issue on GitHub.

 

'; Page::first()->update(['contact' => $contact]); } /* Updates button database entries */ Schema::disableForeignKeyConstraints(); try {Artisan::call('migrate');} catch (exception $e) {} try {DB::table('buttons')->delete();} catch (exception $e) {} try {DB::table('buttons')->truncate();} catch (exception $e) {} try {Artisan::call('db:seed --class="ButtonSeeder" --force');} catch (exception $e) {} Schema::enableForeignKeyConstraints(); try { DB::table('link_types')->updateOrInsert([ 'typename' => 'text', 'title' => 'Text', 'icon' => 'bi bi-fonts', 'description' => 'Add static text to your page that is not clickable.', 'params' => '[{ "tag": "textarea", "id": "static-text", "for": "static_text", "label": "Text", "name": "static_text", "class": "form-control" } ]' ]); } catch (exception $e) {} // Changes saved profile images from littlelink_name to IDs. // This runs every time the updater runs. // Not sure if this will cause any issues. // If it works, I won't touch it. try { $users = DB::table('users')->get(); foreach ($users as $user) { $oldName = $user->littlelink_name . '.png'; $newName = $user->id . '.png'; $oldPath = base_path('img/' . $oldName); $newPath = base_path('img/' . $newName); if (File::exists($oldPath)) { File::move($oldPath, $newPath); }}} catch (exception $e) {} ?>