1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-06 03:50:04 +02:00
Daniel Neto 2023-05-18 09:27:57 -03:00
parent 27e66d89e9
commit d50542d74b

View file

@ -306,8 +306,14 @@ abstract class ObjectYPT implements ObjectInterface
//$escapedValue = $global['mysqli']->real_escape_string($this->$value);
if (strtolower($value) == 'created') {
//var_dump($this->created);exit;
if (!empty($this->created) && (User::isAdmin() || isCommandLineInterface())) {
if (
!empty($this->created) && (
User::isAdmin() ||
isCommandLineInterface() ||
(class_exists('API') && API::isAPISecretValid())
)) {
$this->created = preg_replace('/[^0-9: \/-]/', '', $this->created);
_error_log("created changed in table=".static::getTableName()." id={$this->id} created={$this->created}");
$formats .= 's';
$values[] = $this->created;
$fields[] = " `{$value}` = ? ";