mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-22 09:32:14 +00:00
sanitizing env value before storing into the .env file
This commit is contained in:
@@ -26,7 +26,7 @@ class StoreBroadcastServiceCredentialsController
|
|||||||
'PUSHER_APP_CLUSTER' => $request->input('cluster'),
|
'PUSHER_APP_CLUSTER' => $request->input('cluster'),
|
||||||
'PUSHER_APP_HOST' => '',
|
'PUSHER_APP_HOST' => '',
|
||||||
'PUSHER_APP_PORT' => '',
|
'PUSHER_APP_PORT' => '',
|
||||||
'PUSHER_APP_TLS' => true,
|
'PUSHER_APP_TLS' => 'true',
|
||||||
],
|
],
|
||||||
'native' => [
|
'native' => [
|
||||||
'BROADCAST_DRIVER' => 'pusher',
|
'BROADCAST_DRIVER' => 'pusher',
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ class StoreEnvironmentSettingsController extends Controller
|
|||||||
'PUSHER_APP_CLUSTER' => $request->input('broadcast.cluster'),
|
'PUSHER_APP_CLUSTER' => $request->input('broadcast.cluster'),
|
||||||
'PUSHER_APP_HOST' => '',
|
'PUSHER_APP_HOST' => '',
|
||||||
'PUSHER_APP_PORT' => '',
|
'PUSHER_APP_PORT' => '',
|
||||||
'PUSHER_APP_TLS' => true,
|
'PUSHER_APP_TLS' => 'true',
|
||||||
],
|
],
|
||||||
'native' => [
|
'native' => [
|
||||||
'BROADCAST_DRIVER' => 'pusher',
|
'BROADCAST_DRIVER' => 'pusher',
|
||||||
|
|||||||
@@ -226,9 +226,9 @@ if (! function_exists('setEnvironmentValue')) {
|
|||||||
if ($keyPosition) {
|
if ($keyPosition) {
|
||||||
$endOfLinePosition = strpos($str, "\n", $keyPosition);
|
$endOfLinePosition = strpos($str, "\n", $keyPosition);
|
||||||
$oldLine = substr($str, $keyPosition, $endOfLinePosition - $keyPosition);
|
$oldLine = substr($str, $keyPosition, $endOfLinePosition - $keyPosition);
|
||||||
$str = str_replace($oldLine, "{$envKey}={$envValue}", $str);
|
$str = str_replace($oldLine, "{$envKey}=\"{$envValue}\"", $str);
|
||||||
} else {
|
} else {
|
||||||
$str .= "\n$envKey=$envValue";
|
$str .= "\n$envKey=\"$envValue\"";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user