mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-10-26 02:33:53 +09:00
Merge pull request #1496 from KodeStar/bugfix/update_proxy_and_items_with_no_password
Some checks failed
Mark stale issues and pull requests / stale (push) Has been cancelled
Some checks failed
Mark stale issues and pull requests / stale (push) Has been cancelled
Update items with no password
This commit is contained in:
@@ -268,13 +268,15 @@ class ItemController extends Controller
|
||||
];
|
||||
|
||||
// Proxy management
|
||||
if (isset(getenv('HTTPS_PROXY')) || isset(getenv('https_proxy'))) {
|
||||
$options['proxy']['http'] = getenv('HTTPS_PROXY') ?: getenv('https_proxy');
|
||||
$httpsProxy = getenv('HTTPS_PROXY');
|
||||
$httpsProxyLower = getenv('https_proxy');
|
||||
if ($httpsProxy !== false || $httpsProxyLower !== false) {
|
||||
$options['proxy']['http'] = $httpsProxy ?: $httpsProxyLower;
|
||||
}
|
||||
|
||||
$file = $request->input('icon');
|
||||
$path_parts = pathinfo($file);
|
||||
if (!isset($path_parts['extension'])) {
|
||||
if (!array_key_exists('extension', $path_parts)) {
|
||||
throw ValidationException::withMessages(['file' => 'Icon URL must have a valid file extension.']);
|
||||
}
|
||||
$extension = $path_parts['extension'];
|
||||
@@ -317,7 +319,11 @@ class ItemController extends Controller
|
||||
$storedConfigObject = json_decode($storedItem->getAttribute('description'));
|
||||
|
||||
$configObject = json_decode($config);
|
||||
$configObject->password = $storedConfigObject->password;
|
||||
if ($storedConfigObject && property_exists($storedConfigObject, 'password')) {
|
||||
$configObject->password = $storedConfigObject->password;
|
||||
} else {
|
||||
$configObject->password = null;
|
||||
}
|
||||
|
||||
$config = json_encode($configObject);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user