1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00
This commit is contained in:
Daniel Neto 2023-03-29 10:43:43 -03:00
parent f9a74eb117
commit a4923173a0
2 changed files with 20 additions and 14 deletions

View file

@ -2212,19 +2212,25 @@ class SectionFirstPage
}
$endPointResponse = url_get_contents_with_cache($endpointURL, 300, '', 5, false, true);
$response = json_decode($endPointResponse);
/*
if(User::isLogged()){
session_id($response->session_id);
}
*/
if(!empty($response)){
$this->endpointResponse = $response->response;
$this->totalRows = $this->endpointResponse->totalRows;
}else{
$this->endpointResponse = new stdClass();
$this->totalRows = 0;
//_error_log(gettype($endPointResponse).' '.json_encode($endPointResponse));
if(!empty($endPointResponse)){
if(is_string($endPointResponse)){
$response = json_decode($endPointResponse);
}else{
$response = $endPointResponse;
}
/*
if(User::isLogged()){
session_id($response->session_id);
}
*/
if(!empty($response)){
$this->endpointResponse = $response->response;
$this->totalRows = $this->endpointResponse->totalRows;
}else{
$this->endpointResponse = new stdClass();
$this->totalRows = 0;
}
}
$this->childs = $childs;
}