mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 09:49:28 +02:00
Fixes regarding the encoder process, do not process more then once.
This commit is contained in:
parent
352105fb77
commit
f7dd239f7a
35 changed files with 631 additions and 478 deletions
|
@ -49,15 +49,20 @@ abstract class ObjectYPT implements ObjectInterface {
|
|||
global $advancedCustom;
|
||||
$row = self::getNowFromDB();
|
||||
$dt = new DateTime($row['my_date_field']);
|
||||
$timeZOnesOptions = object_to_array($advancedCustom->timeZone->type);
|
||||
if (empty($timeZOnesOptions[$advancedCustom->timeZone->value])) {
|
||||
if(!empty($_COOKIE['timezone'])){
|
||||
$timezone = $_COOKIE['timezone'];
|
||||
}else{
|
||||
$timeZOnesOptions = object_to_array($advancedCustom->timeZone->type);
|
||||
$timezone = $timeZOnesOptions[$advancedCustom->timeZone->value];
|
||||
}
|
||||
if (empty($timezone)) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
$objDate = new DateTimeZone($timeZOnesOptions[$advancedCustom->timeZone->value]);
|
||||
$objDate = new DateTimeZone($timezone);
|
||||
if (is_object($objDate)) {
|
||||
$dt->setTimezone($objDate);
|
||||
date_default_timezone_set($timeZOnesOptions[$advancedCustom->timeZone->value]);
|
||||
date_default_timezone_set($timezone);
|
||||
return $dt;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue