mirror of
https://github.com/Vateron-Media/XC_VM.git
synced 2026-04-13 08:28:32 +00:00
fix(stream): replace truthy checks with empty() in InternalApiController
Prevent undefined index notices when request fields are missing. Affects user_agent, http_proxy, cookies, headers checks in stream probe/prebuffer logic.
This commit is contained in:
@@ -495,19 +495,19 @@ class InternalApiController {
|
||||
$rURL = $rRequest['url'];
|
||||
$rFetchArguments = array();
|
||||
|
||||
if ($rRequest['user_agent']) {
|
||||
if (!empty($rRequest['user_agent'])) {
|
||||
$rFetchArguments[] = sprintf("-user_agent '%s'", escapeshellcmd($rRequest['user_agent']));
|
||||
}
|
||||
|
||||
if ($rRequest['http_proxy']) {
|
||||
if (!empty($rRequest['http_proxy'])) {
|
||||
$rFetchArguments[] = sprintf("-http_proxy '%s'", escapeshellcmd($rRequest['http_proxy']));
|
||||
}
|
||||
|
||||
if ($rRequest['cookies']) {
|
||||
if (!empty($rRequest['cookies'])) {
|
||||
$rFetchArguments[] = sprintf("-cookies '%s'", escapeshellcmd($rRequest['cookies']));
|
||||
}
|
||||
|
||||
$rHeaders = $rRequest['headers'] ? rtrim($rRequest['headers'], "\r\n") . "\r\n" : '';
|
||||
$rHeaders = !empty($rRequest['headers']) ? rtrim($rRequest['headers'], "\r\n") . "\r\n" : '';
|
||||
$rHeaders .= 'X-XC_VM-Prebuffer:1' . "\r\n";
|
||||
$rFetchArguments[] = sprintf('-headers %s', escapeshellarg($rHeaders));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user