diff --git a/admin/health_check.php b/admin/health_check.php
index 6280d98362..329266cce2 100644
--- a/admin/health_check.php
+++ b/admin/health_check.php
@@ -110,7 +110,7 @@ if(_isSchedulerPresentOnCrontab()){
}else{
$messages['Server'][] = ["Scheduler plugin is NOT installed on your crontab, open your terminal and type 'crontab -e', than add the code: ", "* * * * * php {$global['systemRootPath']}plugin/Scheduler/run.php"];
}
- *
+ *
*/
foreach ($linuxApps as $value) {
@@ -186,7 +186,7 @@ if (empty($verified)) {
-
+
@@ -194,7 +194,7 @@ if (empty($verified)) {
Server
">
-
-
+
+
">
-
-
+
+
">
-
-
+
+
'), array(''', '"', '<', '>'), $return);
+ return str_replace(["'", '"', "<", '>'], [''', '"', '<', '>'], $return);
}
function printJSString($str, $return = false) {
@@ -55,7 +55,7 @@ function isRTL() {
function getAllFlags() {
global $global;
$dir = "{$global['systemRootPath']}view/css/flag-icon-css-master/flags/4x3";
- $flags = array();
+ $flags = [];
if ($handle = opendir($dir)) {
while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != "..") {
@@ -76,7 +76,7 @@ function getAllFlags() {
function getEnabledLangs() {
global $global;
$dir = "{$global['systemRootPath']}locale";
- $flags = array();
+ $flags = [];
if (empty($global['dont_show_us_flag'])) {
$flags[] = 'us';
}
@@ -101,7 +101,7 @@ function textToLink($string, $targetBlank = false) {
}
function br2nl($html) {
- $nl = preg_replace(array('# #i', '##i', '#
#i'), array("\n", "\n", ''), $html);
+ $nl = preg_replace(['# #i', '##i', '#
#i'], ["\n", "\n", ''], $html);
return $nl;
}
diff --git a/locale/index.php b/locale/index.php
index 2d152c33f2..bfcbb9ffb4 100644
--- a/locale/index.php
+++ b/locale/index.php
@@ -25,7 +25,7 @@ if (isset($_GET['getLanguage'])) {
exit;
}
-$vars = array();
+$vars = [];
require_once '../videos/configuration.php';
require_once '../objects/functions.php';
diff --git a/objects/Object.php b/objects/Object.php
index dfb72e58c0..15ac619bbe 100644
--- a/objects/Object.php
+++ b/objects/Object.php
@@ -20,7 +20,7 @@ abstract class ObjectYPT implements ObjectInterface
public static function getSearchFieldsNames()
{
- return array();
+ return [];
}
public function load($id)
@@ -291,7 +291,7 @@ abstract class ObjectYPT implements ObjectInterface
return false;
}
$formats = '';
- $values = array();
+ $values = [];
if (!empty($this->id)) {
$sql = "UPDATE " . static::getTableName() . " SET ";
$fields = [];
@@ -426,7 +426,7 @@ abstract class ObjectYPT implements ObjectInterface
static function ignoreTableSecurityCheck()
{
- $ignoreArray = array(
+ $ignoreArray = [
'vast_campaigns_logs',
'videos', 'CachesInDB',
'plugins',
@@ -438,7 +438,7 @@ abstract class ObjectYPT implements ObjectInterface
'wallet_log',
'live_restreams_logs',
'clone_SitesAllowed'
- );
+ ];
return in_array(static::getTableName(), $ignoreArray);
}
diff --git a/objects/categories.json.php b/objects/categories.json.php
index a9d7dad9bb..07fcf034b6 100644
--- a/objects/categories.json.php
+++ b/objects/categories.json.php
@@ -56,13 +56,13 @@ if (empty($_POST['sort']) && empty($_GET['sort'])) {
array_multisort($array_column, SORT_ASC, $categories);
}
-$json = array(
+$json = [
'current'=>getCurrentPage(),
'rowCount'=>getRowCount(),
'total'=>$total,
'rows'=>$categories,
'onlyWithVideos'=>$onlyWithVideos,
'sameUserGroupAsMe'=>$sameUserGroupAsMe
-);
+];
echo _json_encode($json);
diff --git a/objects/category.php b/objects/category.php
index 57bd1f1086..31cf416789 100644
--- a/objects/category.php
+++ b/objects/category.php
@@ -402,7 +402,7 @@ class Category {
_error_log('getAllCategories getUserGroups');
$users_groups = UserGroups::getUserGroups($sameUserGroupAsMe);
- $users_groups_id = array(0);
+ $users_groups_id = [0];
foreach ($users_groups as $value) {
$users_groups_id[] = $value['id'];
}
@@ -978,10 +978,10 @@ class Category {
public static function setUsergroups($categories_id, $usergroups_ids_array) {
if (!is_array($usergroups_ids_array)) {
- $usergroups_ids_array = array($usergroups_ids_array);
+ $usergroups_ids_array = [$usergroups_ids_array];
}
Categories_has_users_groups::deleteAllFromCategory($categories_id);
- $return = array();
+ $return = [];
foreach ($usergroups_ids_array as $users_groups_id) {
$id = Categories_has_users_groups::saveUsergroup($categories_id, $users_groups_id);
$return[] = $id;
diff --git a/objects/comments.json.php b/objects/comments.json.php
index b20dec5f69..3f08dd3d89 100644
--- a/objects/comments.json.php
+++ b/objects/comments.json.php
@@ -14,7 +14,7 @@ setRowCount(10);
//setDefaultSort('id', 'DESC');
if(empty($_REQUEST['id'])){
if(empty($_POST['sort'])){
- $_POST['sort'] = array();
+ $_POST['sort'] = [];
$_POST['sort']['pin'] = 'DESC';
//$_POST['sort']['comments_id_pai'] = 'IS NULL DESC';
//$_POST['sort']['comments_id_pai'] = 'DESC';
@@ -25,10 +25,10 @@ if(empty($_REQUEST['id'])){
}else{
$comment = Comment::getComment($_REQUEST['id']);
if(!empty($comment)){
- $comments = array($comment);
+ $comments = [$comment];
$total = 1;
}else{
- $comments = array();
+ $comments = [];
$total = 0;
}
}
diff --git a/objects/functionGetHamburgerButton.php b/objects/functionGetHamburgerButton.php
index 162035e53f..2961938c24 100644
--- a/objects/functionGetHamburgerButton.php
+++ b/objects/functionGetHamburgerButton.php
@@ -7,7 +7,7 @@ if ($startActive) {
if ($invert) {
if(preg_match('/style=["\']/', $parameters)){
- $parameters = str_replace(array('style="','style=\''), array('style="transform: scale(-1,1);', 'style=\'transform: scale(-1,1);'), $parameters );
+ $parameters = str_replace(['style="','style=\''], ['style="transform: scale(-1,1);', 'style=\'transform: scale(-1,1);'], $parameters );
}else{
$parameters .= 'style="transform: scale(-1,1);"';
}
diff --git a/objects/functions.php b/objects/functions.php
index d714086160..7b31c47e11 100644
--- a/objects/functions.php
+++ b/objects/functions.php
@@ -8,7 +8,7 @@ $AVideoStorage_UA = "AVideoStorage";
$mysql_connect_was_closed = 1;
if (!isset($global) || !is_array($global)) {
- $global = array();
+ $global = [];
}
/**
@@ -427,7 +427,7 @@ function safeString($text, $strict = false, $try=0){
}
$originalText = $text;
$text = strip_tags($text);
- $text = str_replace(array('&', '<', '>'), array('', '', ''), $text);
+ $text = str_replace(['&', '<', '>'], ['', '', ''], $text);
$text = preg_replace('/(*\w+)[\x00-\x20]+;/u', '', $text);
$text = preg_replace('/(*[0-9A-F]+);*/iu', '', $text);
$text = html_entity_decode($text, ENT_COMPAT, 'UTF-8');
@@ -1559,7 +1559,7 @@ function getVideosURL_V2($fileName, $recreateCache = false)
$pdf = $paths['path'] . "{$cleanfilename}.pdf";
$mp3 = $paths['path'] . "{$cleanfilename}.mp3";
- $extraFiles = array();
+ $extraFiles = [];
if (file_exists($pdf)) {
$extraFilesPDF = getVideosURLPDF($fileName);
if($isAVideo){
@@ -1688,7 +1688,7 @@ function getSources($fileName, $returnArray = false, $try = 0)
} else {
_error_log("getSources($fileName) File not found " . json_encode($video));
if (empty($sources)) {
- $sources = array();
+ $sources = [];
}
$obj = new stdClass();
$obj->type = "video/mp4";
@@ -1785,7 +1785,7 @@ function getImageFormat($file)
}
}
- return array('format' => $format, 'extension' => $extension);
+ return ['format' => $format, 'extension' => $extension];
}
function im_resize($file_src, $file_dest, $wd, $hd, $q = 80)
@@ -1955,7 +1955,7 @@ function scaleUpAndMantainAspectRatioFinalSizes($new_w, $old_w, $new_h, $old_h)
$thumb_w = $old_w * $aspectRatio2;
$thumb_h = $old_h * $aspectRatio2;
}
- return array('w' => $thumb_w, 'h' => $thumb_h);
+ return ['w' => $thumb_w, 'h' => $thumb_h];
}
function scaleUpImage($file_src, $file_dest, $wd, $hd)
@@ -3745,7 +3745,7 @@ function siteMap()
$_POST['sort']['created'] = "DESC";
$rows = Video::getAllVideosLight(!empty($advancedCustom->showPrivateVideosOnSitemap) ? "viewableNotUnlisted" : "publicOnly");
if (empty($rows) || !is_array($rows)) {
- $rows = array();
+ $rows = [];
}
_error_log("siteMap: getAllVideos " . count($rows));
foreach ($rows as $video) {
@@ -4119,7 +4119,7 @@ function convertImageIfNotExists($source, $destination, $width, $height, $scaleU
_error_log("convertImageIfNotExists: source image is empty");
return false;
}
- $source = str_replace(array('_thumbsSmallV2'), array(''), $source);
+ $source = str_replace(['_thumbsSmallV2'], [''], $source);
if (!file_exists($source)) {
_error_log("convertImageIfNotExists: source does not exists {$source}");
return false;
@@ -4640,11 +4640,11 @@ function blackListRegenerateSession()
if (!requestComesFromSafePlace()) {
return false;
}
- $list = array(
+ $list = [
'objects/getCaptcha.php',
'objects/userCreate.json.php',
'objects/videoAddViewCount.json.php',
- );
+ ];
foreach ($list as $needle) {
if (str_ends_with($_SERVER['SCRIPT_NAME'], $needle)) {
return true;
@@ -4657,7 +4657,7 @@ function _mysql_connect($persistent = false, $try = 0)
{
global $global, $mysqlHost, $mysqlUser, $mysqlPass, $mysqlDatabase, $mysqlPort, $mysql_connect_was_closed;
- $checkValues = array('mysqlHost', 'mysqlUser', 'mysqlPass', 'mysqlDatabase');
+ $checkValues = ['mysqlHost', 'mysqlUser', 'mysqlPass', 'mysqlDatabase'];
foreach ($checkValues as $value) {
if (!isset($$value)) {
@@ -5623,14 +5623,14 @@ function getPlayListData()
{
global $playListData;
if (empty($playListData)) {
- $playListData = array();
+ $playListData = [];
}
return $playListData;
}
function getPlayListDataVideosId()
{
- $playListData_videos_id = array();
+ $playListData_videos_id = [];
foreach (getPlayListData() as $value) {
$playListData_videos_id[] = $value->getVideos_id();
}
@@ -5794,7 +5794,7 @@ function isValidEmail($email) {
return false;
}
if(!isset($_email_hosts_checked)){
- $_email_hosts_checked = array();
+ $_email_hosts_checked = [];
}
//Get host name from email and check if it is valid
@@ -5846,7 +5846,7 @@ function isValidURLOrPath($str, $insideCacheOrTmpDirOnly = true) {
return false;
}
- $pathsToCheck = array($absolutePath, $str);
+ $pathsToCheck = [$absolutePath, $str];
foreach ($pathsToCheck as $value) {
if (
@@ -6578,7 +6578,7 @@ function _json_encode($object)
}
$json = json_encode($object);
- $errors = array();
+ $errors = [];
if (empty($json) && json_last_error()) {
if (preg_match('/Malformed UTF-8 characters/i', json_last_error_msg())) {
$json = _json_encode_utf8($object);
@@ -6816,15 +6816,15 @@ function getCaptcha($uid = "", $forceCaptcha = false)
if (empty($uid)) {
$uid = "capcha_" . uniqid();
}
- $contents = getIncludeFileContent($global['systemRootPath'] . 'objects/functiongetCaptcha.php', array('uid' => $uid, 'forceCaptcha' => $forceCaptcha));
+ $contents = getIncludeFileContent($global['systemRootPath'] . 'objects/functiongetCaptcha.php', ['uid' => $uid, 'forceCaptcha' => $forceCaptcha]);
$parts = explode('', '', $parts[1])
- );
+ ];
}
function getSharePopupButton($videos_id, $url = "", $title = "")
@@ -7223,11 +7223,11 @@ function showAlertMessage()
{
$check = ['error', 'msg', 'success', 'toast'];
- $newAlerts = array();
+ $newAlerts = [];
if (!empty($_SESSION['YPTalertMessage'])) {
foreach ($check as $value) {
- $newAlerts[$value] = array();
+ $newAlerts[$value] = [];
}
foreach ($_SESSION['YPTalertMessage'] as $value) {
if (!empty($value[0])) {
@@ -7569,13 +7569,13 @@ function getSocialModal($videos_id, $url = "", $title = "")
$filePath = $global['systemRootPath'] . 'objects/functionGetSocialModal.php';
$contents = getIncludeFileContent(
$filePath,
- array(
+ [
'videos_id' => $videos_id,
'url' => $url,
'title' => $title,
'video' => $video,
'sharingUid' => $sharingUid
- )
+ ]
);
return ['html' => $contents, 'id' => $sharingUid];
}
@@ -7623,7 +7623,7 @@ function getCroppie(
$boundaryHeight = $viewportHeight + $boundary;
$uid = uniqid();
- $varsArray = array(
+ $varsArray = [
'buttonTitle' => $buttonTitle,
'callBackJSFunction' => $callBackJSFunction,
'resultWidth' => $resultWidth,
@@ -7636,7 +7636,7 @@ function getCroppie(
'boundaryWidth' => $boundaryWidth,
'boundaryHeight' => $boundaryHeight,
'uid' => $uid,
- );
+ ];
$contents = getIncludeFileContent($global['systemRootPath'] . 'objects/functionCroppie.php', $varsArray);
@@ -7710,7 +7710,7 @@ function convertVideoToMP3FileIfNotExists($videos_id)
if (empty($video)) {
return false;
}
- $types = array('video', 'audio');
+ $types = ['video', 'audio'];
if (!in_array($video['type'], $types)) {
return false;
}
@@ -7914,7 +7914,7 @@ function canFullScreen()
function getTinyMCE($id, $simpleMode = false)
{
global $global;
- $contents = getIncludeFileContent($global['systemRootPath'] . 'objects/functionsGetTinyMCE.php', array('id' => $id, 'simpleMode' => $simpleMode));
+ $contents = getIncludeFileContent($global['systemRootPath'] . 'objects/functionsGetTinyMCE.php', ['id' => $id, 'simpleMode' => $simpleMode]);
return $contents;
}
@@ -8258,7 +8258,7 @@ function deleteStatsNotifications()
function getLiveVideosFromUsers_id($users_id)
{
- $videos = array();
+ $videos = [];
if (!empty($users_id)) {
$stats = getStatsNotifications();
foreach ($stats["applications"] as $key => $value) {
@@ -8295,7 +8295,7 @@ function getLiveVideosObject($application)
$user = new User($application['users_id']);
$cat = new Category($application['categories_id']);
- $video = array(
+ $video = [
'id' => intval(rand(999999, 9999999)),
'isLive' => 1,
'categories_id' => $application['categories_id'],
@@ -8324,7 +8324,7 @@ function getLiveVideosObject($application)
'galleryCallback' => @$application['callback'],
'stats' => $application,
'embedlink' => addQueryStringParameter($application['href'], 'embed', 1),
- 'images' => array(
+ 'images' => [
"poster" => @$application['poster'],
"posterPortrait" => @$application['poster'],
"posterPortraitPath" => @$application['poster'],
@@ -8339,16 +8339,16 @@ function getLiveVideosObject($application)
"posterLandscapePath" => @$application['poster'],
"posterLandscapeThumbs" => @$application['poster'],
"posterLandscapeThumbsSmall" => @$application['poster']
- ),
- 'videos' => array(
- "m3u8" => array(
+ ],
+ 'videos' => [
+ "m3u8" => [
"url" => $m3u8,
"url_noCDN" => $m3u8,
"type" => "video",
"format" => "m3u8",
"resolution" => "auto"
- )
- ),
+ ]
+ ],
'Poster' => @$application['poster'],
'Thumbnail' => @$application['poster'],
'createdHumanTiming' => 'Live',
@@ -8371,36 +8371,36 @@ function getLiveVideosObject($application)
"category_description" => $cat->getDescription(),
"videoCreation" => date('Y-m-d H:i:s'),
"videoModified" => date('Y-m-d H:i:s'),
- "groups" => array(),
- "tags" => array(),
+ "groups" => [],
+ "tags" => [],
"videoTags" => [
- array(
+ [
"type_name" => "Starring",
"name" => ""
- ),
- array(
+ ],
+ [
"type_name" => "Language",
"name" => "English"
- ),
- array(
+ ],
+ [
"type_name" => "Release_Date",
"name" => date('Y')
- ),
- array(
+ ],
+ [
"type_name" => "Running_Time",
"name" => ""
- ),
- array(
+ ],
+ [
"type_name" => "Genres",
"name" => $cat->getName()
- )
+ ]
],
- "videoTagsObject" => array('Starring' => array(), 'Language' => array("English"), 'Release_Date' => array(date('Y')), 'Running_Time' => array('0'), 'Genres' => array($cat->getName())),
+ "videoTagsObject" => ['Starring' => [], 'Language' => ["English"], 'Release_Date' => [date('Y')], 'Running_Time' => ['0'], 'Genres' => [$cat->getName()]],
'descriptionHTML' => '',
- "progress" => array(
+ "progress" => [
"percent" => 0,
"lastVideoTime" => 0
- ),
+ ],
"isFavorite" => null,
"isWatchLater" => null,
"favoriteId" => null,
@@ -8425,7 +8425,7 @@ function getLiveVideosObject($application)
"wwbnChannelURL" => $user->getChannelLink(),
"wwbnImgChannel" => $user->getPhoto(),
"wwbnType" => "live",
- );
+ ];
//var_dump($videos);exit;
return $video;
}
@@ -8433,7 +8433,7 @@ function getLiveVideosObject($application)
function getLiveVideosFromCategory($categories_id)
{
$stats = getStatsNotifications();
- $videos = array();
+ $videos = [];
if (!empty($categories_id)) {
foreach ($stats["applications"] as $key => $value) {
if (empty($value['categories_id']) || $categories_id != $value['categories_id']) {
@@ -8511,7 +8511,7 @@ function getStatsNotifications($force_recreate = false, $listItIfIsAdminOrOwner
$count++;
}
if (!empty($json['applications'])) {
- $applications = array();
+ $applications = [];
foreach ($json['applications'] as $key => $value) {
// remove duplicated
if (!is_array($value) || empty($value['href']) || in_array($value['href'], $applications)) {
@@ -8534,7 +8534,7 @@ function getStatsNotifications($force_recreate = false, $listItIfIsAdminOrOwner
}
if (empty($json['applications'])) {
- $json['applications'] = array();
+ $json['applications'] = [];
}
foreach ($json['applications'] as $key => $value) {
@@ -8648,7 +8648,7 @@ function getLiveUsersLabelHTML($viewsClass = "label label-default", $counterClas
$_getLiveUsersLabelHTML = 1;
$htmlMediaTag = '';
$htmlMediaTag .= '';
- $htmlMediaTag .= getIncludeFileContent($global['systemRootPath'] . 'plugin/Live/view/onlineLabel.php', array('viewsClass' => $viewsClass, 'counterClass' => $counterClass));
+ $htmlMediaTag .= getIncludeFileContent($global['systemRootPath'] . 'plugin/Live/view/onlineLabel.php', ['viewsClass' => $viewsClass, 'counterClass' => $counterClass]);
$htmlMediaTag .= getLiveUsersLabel($viewsClass, $counterClass);
$htmlMediaTag .= '
';
return $htmlMediaTag;
@@ -9020,7 +9020,7 @@ function getHashMethodsAndInfo()
$iv = substr($saltMD5, 0, $ivlen);
$key = substr($saltMD5, 0, $keylen);
- $_getHashMethod = array('cipher_algo' => $cipher_algo, 'iv' => $iv, 'key' => $key, 'base' => $base, 'salt' => $global['salt']);
+ $_getHashMethod = ['cipher_algo' => $cipher_algo, 'iv' => $iv, 'key' => $key, 'base' => $base, 'salt' => $global['salt']];
}
return $_getHashMethod;
}
@@ -9049,7 +9049,7 @@ function idToHash($id)
$hash = preg_replace('/(=+)$/', '', $hash);
$hash = str_replace(['/', '+', '='], ['_', '-', '.'], $hash);
if (empty($hash)) {
- _error_log('idToHash error: ' . openssl_error_string() . PHP_EOL . json_encode(array('id' => $id, 'cipher_algo' => $cipher_algo, 'base' => $base, 'idConverted' => $idConverted, 'hash' => $hash, 'iv' => $iv)));
+ _error_log('idToHash error: ' . openssl_error_string() . PHP_EOL . json_encode(['id' => $id, 'cipher_algo' => $cipher_algo, 'base' => $base, 'idConverted' => $idConverted, 'hash' => $hash, 'iv' => $iv]));
if (!empty($global['useLongHash'])) {
$global['useLongHash'] = 0;
return idToHash($id);
@@ -9663,7 +9663,7 @@ function isHTMLEmpty($html_string)
{
$html_string_no_tags = strip_specific_tags($html_string, ['br', 'p', 'span', 'div']);
//var_dump($html_string_no_tags, $html_string);
- return empty(trim(str_replace(array("\r", "\n"), array('', ''), $html_string_no_tags)));
+ return empty(trim(str_replace(["\r", "\n"], ['', ''], $html_string_no_tags)));
}
function emptyHTML($html_string)
@@ -9766,7 +9766,7 @@ function isDummyFile($filePath)
global $_isDummyFile;
if (!isset($_isDummyFile)) {
- $_isDummyFile = array();
+ $_isDummyFile = [];
}
if (isset($_isDummyFile[$filePath])) {
return $_isDummyFile[$filePath];
@@ -9799,7 +9799,7 @@ function forbiddenPageIfCannotEmbed($videos_id)
if (!isAVideoMobileApp()) {
if (!isSameDomain(@$_SERVER['HTTP_REFERER'], $global['webSiteRootURL'])) {
if (!empty($advancedCustomUser->blockEmbedFromSharedVideos) && !CustomizeUser::canShareVideosFromVideo($videos_id)) {
- $reason = array();
+ $reason = [];
if (!empty($advancedCustomUser->blockEmbedFromSharedVideos)) {
error_log("forbiddenPageIfCannotEmbed: Embed is forbidden: \$advancedCustomUser->blockEmbedFromSharedVideos");
$reason[] = __('Admin block video sharing');
@@ -9825,9 +9825,9 @@ function getMediaSessionPosters($imagePath)
if (empty($imagePath) || !file_exists($imagePath)) {
return false;
}
- $sizes = array(96, 128, 192, 256, 384, 512);
+ $sizes = [96, 128, 192, 256, 384, 512];
- $posters = array();
+ $posters = [];
foreach ($sizes as $value) {
$destination = str_replace('.jpg', "_{$value}.jpg", $imagePath);
@@ -9836,7 +9836,7 @@ function getMediaSessionPosters($imagePath)
$convertedImage = convertImageIfNotExists($imagePath, $destination, $value, $value);
$relativePath = str_replace($global['systemRootPath'], '', $convertedImage);
$url = getURL($relativePath);
- $posters[$value] = array('path' => $path, 'relativePath' => $relativePath, 'url' => $url);
+ $posters[$value] = ['path' => $path, 'relativePath' => $relativePath, 'url' => $url];
}
}
return $posters;
@@ -9847,7 +9847,7 @@ function deleteMediaSessionPosters($imagePath)
if (empty($imagePath)) {
return false;
}
- $sizes = array(96, 128, 192, 256, 384, 512);
+ $sizes = [96, 128, 192, 256, 384, 512];
foreach ($sizes as $value) {
$destination = str_replace('.jpg', "_{$value}.jpg", $imagePath);
@@ -9919,7 +9919,7 @@ function _ob_get_clean()
return $content;
}
-function getIncludeFileContent($filePath, $varsArray = array())
+function getIncludeFileContent($filePath, $varsArray = [])
{
global $global, $config;
if (!empty($global['getIncludeFileContent'])) {
@@ -9929,7 +9929,7 @@ function getIncludeFileContent($filePath, $varsArray = array())
}
}
-function getIncludeFileContentV1($filePath, $varsArray = array())
+function getIncludeFileContentV1($filePath, $varsArray = [])
{
global $global, $config;
foreach ($varsArray as $key => $value) {
@@ -9967,7 +9967,7 @@ function getIncludeFileContentV1($filePath, $varsArray = array())
return $return;
}
-function getIncludeFileContentV2($filePath, $varsArray = array())
+function getIncludeFileContentV2($filePath, $varsArray = [])
{
global $global, $config;
foreach ($varsArray as $key => $value) {
@@ -10074,7 +10074,7 @@ function getValidCrontabLines()
if (empty($validCrontabLines)) {
$crontab = shell_exec('crontab -l');
$crontabLines = preg_split("/\r\n|\n|\r/", $crontab);
- $_validCrontabLines = array();
+ $_validCrontabLines = [];
foreach ($crontabLines as $line) {
$line = trim($line);
@@ -10094,12 +10094,12 @@ function getValidCrontabLines()
function is_email($strOrArray)
{
if (empty($strOrArray)) {
- return array();
+ return [];
}
if (!is_array($strOrArray)) {
- $strOrArray = array($strOrArray);
+ $strOrArray = [$strOrArray];
}
- $valid_emails = array();
+ $valid_emails = [];
foreach ($strOrArray as $email) {
if (is_numeric($email)) {
$email = User::getEmailDb($email);
@@ -10123,10 +10123,10 @@ function getHamburgerButton($id = '', $type = 0, $parameters = 'class="btn btn-d
{
global $global;
if ($type === 'x') {
- $XOptions = array(1, 4, 6, 7, 8);
+ $XOptions = [1, 4, 6, 7, 8];
$type = $XOptions[rand(0, 4)];
} else if ($type === '<-') {
- $XOptions = array(2, 5);
+ $XOptions = [2, 5];
$type = $XOptions[rand(0, 1)];
}
$type = intval($type);
@@ -10137,7 +10137,7 @@ function getHamburgerButton($id = '', $type = 0, $parameters = 'class="btn btn-d
$id = uniqid();
}
$filePath = $global['systemRootPath'] . 'objects/functionGetHamburgerButton.php';
- return getIncludeFileContent($filePath, array('type' => $type, 'id' => $id, 'parameters' => $parameters, 'startActive' => $startActive, 'invert' => $invert));
+ return getIncludeFileContent($filePath, ['type' => $type, 'id' => $id, 'parameters' => $parameters, 'startActive' => $startActive, 'invert' => $invert]);
}
function getUserOnlineLabel($users_id, $class = '', $style = '')
@@ -10411,9 +10411,9 @@ function addTwitterJS($text)
function getMP3ANDMP4DownloadLinksFromHLS($videos_id, $video_type)
{
- $downloadOptions = array();
+ $downloadOptions = [];
if (empty($videos_id)) {
- return array();
+ return [];
}
if (empty($video_type)) {
$video = Video::getVideoLight($videos_id);
@@ -10503,7 +10503,7 @@ function getIframePaths()
$url = addQueryStringParameter($url, $key, $value);
}
- return array('relative' => $relativeSRC, 'url' => $url, 'path' => "{$global['systemRootPath']}{$relativeSRC}", 'modeYoutube' => $modeYoutube);
+ return ['relative' => $relativeSRC, 'url' => $url, 'path' => "{$global['systemRootPath']}{$relativeSRC}", 'modeYoutube' => $modeYoutube];
}
function getFeedButton($rss, $mrss, $roku)
@@ -10551,7 +10551,7 @@ function isSafari()
function fixQuotes($str)
{
- $chr_map = array(
+ $chr_map = [
// Windows codepage 1252
"\xC2\x82" => "'", // U+0082⇒U+201A single low-9 quotation mark
"\xC2\x84" => '"', // U+0084⇒U+201E double low-9 quotation mark
@@ -10575,7 +10575,7 @@ function fixQuotes($str)
"\xE2\x80\x9F" => '"', // U+201F double high-reversed-9 quotation mark
"\xE2\x80\xB9" => "'", // U+2039 single left-pointing angle quotation mark
"\xE2\x80\xBA" => "'", // U+203A single right-pointing angle quotation mark
- );
+ ];
$chr = array_keys($chr_map); // but: for efficiency you should
$rpl = array_values($chr_map); // pre-calculate these two arrays
$str = str_replace($chr, $rpl, html_entity_decode($str, ENT_QUOTES, "UTF-8"));
diff --git a/objects/mention.json.php b/objects/mention.json.php
index 6b320e48f6..302bf5c4ab 100644
--- a/objects/mention.json.php
+++ b/objects/mention.json.php
@@ -10,18 +10,18 @@ header('Content-Type: application/json');
$_POST['current'] = 1;
$_REQUEST['rowCount'] = 10;
-$response = array();
+$response = [];
if(preg_match('/^@/', $_REQUEST['term'])){
$_GET['searchPhrase'] = xss_esc(substr($_REQUEST['term'], 1));
$ignoreAdmin = true;
$users = User::getAllUsers($ignoreAdmin, ['name', 'email', 'user', 'channelName'], 'a');
foreach ($users as $key => $value) {
- $response[] = array(
+ $response[] = [
'id'=>$value['id'],
'value'=>$value['identification'],
'label'=>Video::getCreatorHTML($value['id'], '', true, true)
- );
+ ];
}
}
diff --git a/objects/playlist.php b/objects/playlist.php
index 669d7987f5..a304d7ea5a 100644
--- a/objects/playlist.php
+++ b/objects/playlist.php
@@ -204,7 +204,7 @@ class PlayList extends ObjectYPT {
}
} else {
//die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
- $rows = array();
+ $rows = [];
}
return $rows;
}
@@ -259,7 +259,7 @@ class PlayList extends ObjectYPT {
if ($res !== false) {
foreach ($fullData as $row) {
$row = cleanUpRowFromDatabase($row);
- $row['videos'] = array();
+ $row['videos'] = [];
if ($onlyWithVideos) {
$row['videos'] = self::getVideosIDFromPlaylistLight($row['id']);
if (empty($row['videos'])) {
@@ -270,7 +270,7 @@ class PlayList extends ObjectYPT {
}
} else {
//die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
- $rows = array();
+ $rows = [];
}
return $rows;
}
@@ -389,7 +389,7 @@ class PlayList extends ObjectYPT {
}
} else {
//die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
- $rows = array();
+ $rows = [];
}
$getVideosIDFromPlaylistLight[$playlists_id] = $rows;
return $rows;
@@ -457,7 +457,7 @@ class PlayList extends ObjectYPT {
$cache = self::setCache($cacheName, $rows);
} else {
//die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
- $rows = array();
+ $rows = [];
}
} else {
$rows = object_to_array($rows);
@@ -840,7 +840,7 @@ class PlayList extends ObjectYPT {
}
} else {
//die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
- $rows = array();
+ $rows = [];
}
return $rows;
}
diff --git a/objects/playlistsFromUserVideos.json.php b/objects/playlistsFromUserVideos.json.php
index a6ad792571..7c20aa3a9a 100644
--- a/objects/playlistsFromUserVideos.json.php
+++ b/objects/playlistsFromUserVideos.json.php
@@ -17,9 +17,9 @@ require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once './playlist.php';
header('Content-Type: application/json');
if(is_array($_POST['videos_id'])){
- $rows = array();
+ $rows = [];
foreach ($_POST['videos_id'] as $value) {
- $rows[] = array('videos_id'=>$value, 'playlists'=>PlayList::getAllFromUserVideo($_POST['users_id'], $value, false));
+ $rows[] = ['videos_id'=>$value, 'playlists'=>PlayList::getAllFromUserVideo($_POST['users_id'], $value, false)];
}
echo json_encode($rows);
}else{
diff --git a/objects/security.php b/objects/security.php
index a951790969..e2bf03c2bf 100644
--- a/objects/security.php
+++ b/objects/security.php
@@ -80,12 +80,12 @@ foreach ($scanVars as $value) {
if (!empty($scanThis[$value])) {
if (is_string($scanThis[$value])) {
$scanThis[$value] = fixQuotesIfSafari($scanThis[$value]);
- $scanThis[$value] = str_replace(array("'","`"), array('', ''), trim($scanThis[$value]));
+ $scanThis[$value] = str_replace(["'","`"], ['', ''], trim($scanThis[$value]));
} elseif (is_array($scanThis[$value])) {
foreach ($scanThis[$value] as $key => $value2) {
if (is_string($scanThis[$value][$key])) {
$scanThis[$value] = fixQuotesIfSafari($scanThis[$value]);
- $scanThis[$value][$key] = str_replace(array("'","`"), array('', ''), trim($scanThis[$value][$key]));
+ $scanThis[$value][$key] = str_replace(["'","`"], ['', ''], trim($scanThis[$value][$key]));
}
}
}
diff --git a/objects/uploadChannelArt.json.php b/objects/uploadChannelArt.json.php
index bb3d6f41fc..06a8639b3b 100644
--- a/objects/uploadChannelArt.json.php
+++ b/objects/uploadChannelArt.json.php
@@ -21,7 +21,7 @@ $obj->imagePNG = "{$obj->imageJPG}.png";
$obj->imagePNGResponse = saveCroppieImage($obj->imagePNG, "image");
$obj->imageJPGResponse = convertImage($obj->imagePNG, $obj->imageJPG, 70);
-$obj->variations = array();
+$obj->variations = [];
//var_dump($obj);
if (file_exists($obj->imagePNG)) {
unlink($obj->imagePNG);
diff --git a/objects/user.php b/objects/user.php
index 113143279e..bfe100de5c 100644
--- a/objects/user.php
+++ b/objects/user.php
@@ -55,16 +55,16 @@ class User {
public static $channel_artDesktopMax = 'desktop_max';
public static $channel_artTablet = 'tablet';
public static $channel_artDesktopMin = 'desktop_min';
- public static $channel_art = array(
- 'TV' => array('tv', 2550, 1440),
- 'DesktopMax' => array('desktop_max', 2550, 423),
- 'tablet' => array('tablet', 1855, 423),
- 'DesktopMin' => array('desktop_min', 1546, 423)
- );
+ public static $channel_art = [
+ 'TV' => ['tv', 2550, 1440],
+ 'DesktopMax' => ['desktop_max', 2550, 423],
+ 'tablet' => ['tablet', 1855, 423],
+ 'DesktopMin' => ['desktop_min', 1546, 423]
+ ];
public static $is_company_status_NOTCOMPANY = 0;
public static $is_company_status_ISACOMPANY = 1;
public static $is_company_status_WAITINGAPPROVAL = 2;
- public static $is_company_status = array(0 => 'Not a Company', 1 => 'Active Company', 2 => 'Company waiting for approval');
+ public static $is_company_status = [0 => 'Not a Company', 1 => 'Active Company', 2 => 'Company waiting for approval'];
public function __construct($id, $user = "", $password = "") {
if (empty($id)) {
@@ -940,13 +940,13 @@ if (typeof gtag !== \"function\") {
global $global;
if (!empty($this->id)) {
- $arrayTables = array(
+ $arrayTables = [
//'live_transmition_history_log',
'live_transmitions',
'users_login_history',
'audit',
'ppvlive_purchases',
- );
+ ];
foreach ($arrayTables as $value) {
$sql = "DELETE FROM {$value} WHERE users_id = ?";
@@ -1198,7 +1198,7 @@ if (typeof gtag !== \"function\") {
if (!empty($users_id)) {
if (!isset($_is_a_company)) {
- $_is_a_company = array();
+ $_is_a_company = [];
}
if (!isset($_is_a_company[$users_id])) {
$user = new User($users_id);
@@ -1282,7 +1282,7 @@ if (typeof gtag !== \"function\") {
}
$can = !empty($this->isAdmin) || !empty($this->canStream);
if(empty($can)){
- $reasons = array();
+ $reasons = [];
if(empty($this->isAdmin)){
$reasons[] = 'User is not admin';
}
@@ -2374,7 +2374,7 @@ if (typeof gtag !== \"function\") {
return false;
}
if (!isset($_sendVerificationLink_sent)) {
- $_sendVerificationLink_sent = array();
+ $_sendVerificationLink_sent = [];
}
//Only send the verification email each 30 minutes
if (!empty($_sendVerificationLink_sent[$users_id])) {
@@ -2468,7 +2468,7 @@ if (typeof gtag !== \"function\") {
}
if (!isset($_createVerificationCode)) {
- $_createVerificationCode = array();
+ $_createVerificationCode = [];
}
if (empty($_createVerificationCode[$users_id])) {
@@ -2973,7 +2973,7 @@ if (typeof gtag !== \"function\") {
$value = $user->getExternalOptions('DonationButtons');
$json = _json_decode($value);
if (empty($json)) {
- return array();
+ return [];
}
return $json;
}
diff --git a/objects/userGroups.php b/objects/userGroups.php
index 8d779d6691..dc94125209 100644
--- a/objects/userGroups.php
+++ b/objects/userGroups.php
@@ -278,7 +278,7 @@ class UserGroups{
}
if(!isset($__getUserGroups)){
- $__getUserGroups = array();
+ $__getUserGroups = [];
}
if(isset($__getUserGroups[$users_id])){
@@ -403,7 +403,7 @@ class UserGroups{
return false;
}
if (!is_array($array_groups_id)) {
- $array_groups_id = array($array_groups_id);
+ $array_groups_id = [$array_groups_id];
}
if ($mergeWithCurrentUserGroups) {
@@ -482,12 +482,12 @@ class UserGroups{
global $_getVideosAndCategoriesUserGroups;
if(!isset($_getVideosAndCategoriesUserGroups)){
- $_getVideosAndCategoriesUserGroups = array();
+ $_getVideosAndCategoriesUserGroups = [];
}
if(!empty($force) || !isset($_getVideosAndCategoriesUserGroups[$videos_id])){
$videosug = self::getVideoGroups($videos_id);
$categoriessug = self::getCategoriesGroups($videos_id);
- $response = array();
+ $response = [];
foreach ($videosug as $value) {
$value['isVideoUserGroup'] = 1;
$value['isCategoryUserGroup'] = 0;
diff --git a/objects/users.json.php b/objects/users.json.php
index 117cadacb2..c7828469be 100644
--- a/objects/users.json.php
+++ b/objects/users.json.php
@@ -19,10 +19,10 @@ if (!empty($_REQUEST['users_id'])) {
//echo __LINE__, PHP_EOL;
$user = User::getUserFromID($_REQUEST['users_id']);
if (!empty($user)) {
- $users = array($user);
+ $users = [$user];
$total = 1;
} else {
- $users = array();
+ $users = [];
$total = 0;
}
} else if (empty($_REQUEST['user_groups_id'])) {
@@ -59,7 +59,7 @@ if (empty($users)) {
} else {
foreach ($users as $key => $value) {
if(!$canAdminUsers){
- $u = array();
+ $u = [];
$u['id'] = $value['id'];
//$u['user'] = $user['user'];
$u['identification'] = $value['identification'];
diff --git a/objects/video.php b/objects/video.php
index ceaf51b49f..13d3957209 100644
--- a/objects/video.php
+++ b/objects/video.php
@@ -1242,7 +1242,7 @@ if (!class_exists('Video')) {
public static function getAllVideos($status = "viewable", $showOnlyLoggedUserVideos = false, $ignoreGroup = false, $videosArrayId = [], $getStatistcs = false, $showUnlisted = false, $activeUsersOnly = true, $suggestedOnly = false, $is_serie = null, $type = '') {
global $global, $config, $advancedCustom, $advancedCustomUser;
if ($config->currentVersionLowerThen('11.7')) {
- return array();
+ return [];
}
$tolerance = 0.5;
/**
@@ -1482,7 +1482,7 @@ if (!class_exists('Video')) {
TimeLogEnd($timeLogName, __LINE__, 0.2);
- $allowedDurationTypes = array('video', 'audio');
+ $allowedDurationTypes = ['video', 'audio'];
/**
*
@@ -1654,9 +1654,9 @@ if (!class_exists('Video')) {
$MediaMetadata->title = $video['title'];
$MediaMetadata->artist = $video['identification'];
$MediaMetadata->album = $video['category'];
- $MediaMetadata->artwork = array();
+ $MediaMetadata->artwork = [];
foreach ($posters as $key => $value) {
- $MediaMetadata->artwork[] = array('src' => $value['url'], 'sizes' => "{$key}x{$key}", 'type' => 'image/jpg');
+ $MediaMetadata->artwork[] = ['src' => $value['url'], 'sizes' => "{$key}x{$key}", 'type' => 'image/jpg'];
}
return $MediaMetadata;
}
@@ -1771,7 +1771,7 @@ if (!class_exists('Video')) {
public static function getAllVideosLight($status = "viewable", $showOnlyLoggedUserVideos = false, $showUnlisted = false, $suggestedOnly = false, $type = '') {
global $global, $config;
if ($config->currentVersionLowerThen('5')) {
- return array();
+ return [];
}
$status = str_replace("'", "", $status);
if ($status === 'suggested') {
@@ -1861,7 +1861,7 @@ if (!class_exists('Video')) {
}
//$videos = $res->fetch_all(MYSQLI_ASSOC);
} else {
- $videos = array();
+ $videos = [];
//die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
return $videos;
@@ -2039,10 +2039,10 @@ if (!class_exists('Video')) {
if ($advancedCustomUser->videosSearchAlsoSearchesOnChannelName) {
$searchFieldsNames[] = 'u.channelName';
}
- $newSearchFieldsNames = array();
+ $newSearchFieldsNames = [];
if (!empty($_REQUEST['searchFieldsNames'])) {
if (!is_array($_REQUEST['searchFieldsNames'])) {
- $_REQUEST['searchFieldsNames'] = array($_REQUEST['searchFieldsNames']);
+ $_REQUEST['searchFieldsNames'] = [$_REQUEST['searchFieldsNames']];
}
foreach ($_REQUEST['searchFieldsNames'] as $value) {
if (in_array($value, $searchFieldsNames)) {
@@ -2606,10 +2606,10 @@ if (!class_exists('Video')) {
}
// if you're not admin you can only manage your videos
- $users_id = array($this->users_id, $this->users_id_company);
+ $users_id = [$this->users_id, $this->users_id_company];
if ($advancedCustomUser->userCanChangeVideoOwner) {
$video = new Video("", "", $this->id); // query again to make sure the user is not changing the owner
- $users_id = array($video->getUsers_id(), $video->getUsers_id_company());
+ $users_id = [$video->getUsers_id(), $video->getUsers_id_company()];
}
//var_dump(User::getId(), $users_id, $video, $this);
if (!in_array(User::getId(), $users_id)) {
@@ -2681,7 +2681,7 @@ if (!class_exists('Video')) {
if (empty($value2->label) || empty($value2->text)) {
continue;
}
- $valid_tags = array(__("Paid Content"), __("Group"), __("Plugin"), __("Rating"));
+ $valid_tags = [__("Paid Content"), __("Group"), __("Plugin"), __("Rating")];
if (!in_array($value2->label, $valid_tags)) {
continue;
}
@@ -2844,7 +2844,7 @@ if (!class_exists('Video')) {
//$objTag->text = __("Public");
}
} else {
- $groupNames = array();
+ $groupNames = [];
foreach ($groups as $value) {
$groupNames[] = $value['group_name'];
}
@@ -4376,9 +4376,9 @@ if (!class_exists('Video')) {
}
if (defaultIsLandscape()) {
- $return->default = array('url' => $return->posterLandscape, 'path' => $return->posterLandscapePath);
+ $return->default = ['url' => $return->posterLandscape, 'path' => $return->posterLandscapePath];
} else {
- $return->default = array('url' => $return->posterPortrait, 'path' => $return->posterPortraitPath);
+ $return->default = ['url' => $return->posterPortrait, 'path' => $return->posterPortraitPath];
}
return $return;
@@ -5172,7 +5172,7 @@ if (!class_exists('Video')) {
*/
$status = $video->getStatus();
- $buttons = array();
+ $buttons = [];
$totalStatusButtons = count($statusThatTheUserCanUpdate);
foreach ($statusThatTheUserCanUpdate as $key => $value) {
$index = $key + 1;
@@ -5651,7 +5651,7 @@ if (!class_exists('Video')) {
global $advancedCustom, $_getSeoTags;
if (!isset($_getSeoTags)) {
- $_getSeoTags = array();
+ $_getSeoTags = [];
}
if (!empty($_getSeoTags[$videos_id])) {
@@ -5687,23 +5687,23 @@ if (!class_exists('Video')) {
$image = Video::getImageFromID($videos_id);
- $tags = array(
+ $tags = [
'h1' => $H1_title,
'h2' => $H2_Short_summary,
- );
- $meta = array(
+ ];
+ $meta = [
'description' => $MetaDescription,
'keywords' => $keywords,
'author' => User::getNameIdentificationById($video->getUsers_id())
- );
- $itemprops = array(
+ ];
+ $itemprops = [
'name' => $H1_title,
'thumbnailUrl' => $image->default['url'],
'contentURL' => Video::getLink($videos_id, $video->getClean_title()),
'embedURL' => Video::getLink($videos_id, $video->getClean_title(), true),
'uploadDate' => $video->getCreated(),
'description' => $MetaDescription
- );
+ ];
$head = '';
foreach ($meta as $key => $value) {
@@ -5727,8 +5727,8 @@ if (!class_exists('Video')) {
$body .= " ";
}
$body .= '';
- $response = array();
- $response['assets'] = array('tags' => $tags, 'meta' => $meta, 'itemprops' => $itemprops);
+ $response = [];
+ $response['assets'] = ['tags' => $tags, 'meta' => $meta, 'itemprops' => $itemprops];
$response['head'] = $head;
$response['body'] = $body;
$_getSeoTags[$videos_id] = $response;
@@ -5769,12 +5769,12 @@ if (!class_exists('Video')) {
global $config, $_getEPG;
if (!isset($_getEPG)) {
- $_getEPG = array();
+ $_getEPG = [];
}
if (!isset($_getEPG[$videos_id])) {
$sql = "SELECT * FROM `videos` WHERE id = ? AND `type` = 'linkVideo' AND epg_link IS NOT NULL AND epg_link != ''";
- $res = sqlDAL::readSql($sql, 'i', array($videos_id));
+ $res = sqlDAL::readSql($sql, 'i', [$videos_id]);
$video = sqlDAL::fetchAssoc($res);
sqlDAL::close($res);
@@ -5810,7 +5810,7 @@ if (!empty($_GET['v']) && empty($_GET['videoName'])) {
$_GET['videoName'] = Video::get_clean_title($_GET['v']);
}
-$statusThatShowTheCompleteMenu = array(
+$statusThatShowTheCompleteMenu = [
Video::$statusActive,
Video::$statusInactive,
Video::$statusScheduledReleaseDate,
@@ -5818,9 +5818,9 @@ $statusThatShowTheCompleteMenu = array(
Video::$statusUnlistedButSearchable,
Video::$statusUnlisted,
Video::$statusFansOnly,
-);
+];
-$statusSearchFilter = array(
+$statusSearchFilter = [
Video::$statusActive,
Video::$statusInactive,
Video::$statusScheduledReleaseDate,
@@ -5829,11 +5829,11 @@ $statusSearchFilter = array(
Video::$statusUnlisted,
Video::$statusUnlistedButSearchable,
Video::$statusBrokenMissingFiles,
-);
+];
-$statusThatTheUserCanUpdate = array(
- array(Video::$statusActive, '#0A0'),
- array(Video::$statusInactive, '#B00'),
- array(Video::$statusUnlisted, '#AAA'),
- array(Video::$statusUnlistedButSearchable, '#BBB'),
-);
+$statusThatTheUserCanUpdate = [
+ [Video::$statusActive, '#0A0'],
+ [Video::$statusInactive, '#B00'],
+ [Video::$statusUnlisted, '#AAA'],
+ [Video::$statusUnlistedButSearchable, '#BBB'],
+];
diff --git a/objects/videoSuggest.php b/objects/videoSuggest.php
index 0d6ca52e91..9c3c5291be 100644
--- a/objects/videoSuggest.php
+++ b/objects/videoSuggest.php
@@ -8,8 +8,8 @@ if (!isset($global['systemRootPath'])) {
$obj = new stdClass();
$obj->msg = '';
$obj->error = true;
-$obj->idsToSave = array();
-$obj->idSaved = array();
+$obj->idsToSave = [];
+$obj->idSaved = [];
require_once $global['systemRootPath'] . 'objects/user.php';
if (!Permissions::canModerateVideos()) {
diff --git a/objects/video_statistic.php b/objects/video_statistic.php
index 6c488b6abb..9db3408cc6 100644
--- a/objects/video_statistic.php
+++ b/objects/video_statistic.php
@@ -606,7 +606,7 @@ class VideoStatistic extends ObjectYPT {
}
} else {
//die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
- $rows = array();
+ $rows = [];
}
return $rows;
}
@@ -667,7 +667,7 @@ class VideoStatistic extends ObjectYPT {
$res = sqlDAL::readSql($sql, $formats, $values);
$fullData = sqlDAL::fetchAllAssoc($res);
sqlDAL::close($res);
- $rows = array();
+ $rows = [];
if ($res != false) {
$totalViews = 0;
$totalWatchingTime = 0;
diff --git a/view/channelBody.php b/view/channelBody.php
index 0d236aa080..e34c724372 100644
--- a/view/channelBody.php
+++ b/view/channelBody.php
@@ -40,14 +40,14 @@ $type = '';
if($advancedCustomUser->showArticlesTab && AVideoPlugin::isEnabledByName('Articles')){
$uploadedTotalArticles = Video::getTotalVideos($status, $user_id, !isToHidePrivateVideos(), $showUnlisted, true, false, 'article');
if(!empty($uploadedTotalArticles)){
- $uploadedArticles = Video::getAllVideos($status, $user_id, !isToHidePrivateVideos(), array(), false, $showUnlisted, true, false, null, 'article');
+ $uploadedArticles = Video::getAllVideos($status, $user_id, !isToHidePrivateVideos(), [], false, $showUnlisted, true, false, null, 'article');
}
$type = 'notArticle';
}
if($advancedCustomUser->showAudioTab){
$uploadedTotalAudio = Video::getTotalVideos($status, $user_id, !isToHidePrivateVideos(), $showUnlisted, true, false, 'audio');
if(!empty($uploadedTotalAudio)){
- $uploadedAudio = Video::getAllVideos($status, $user_id, !isToHidePrivateVideos(), array(), false, $showUnlisted, true, false, null, 'audio');
+ $uploadedAudio = Video::getAllVideos($status, $user_id, !isToHidePrivateVideos(), [], false, $showUnlisted, true, false, null, 'audio');
}
//var_dump($uploadedAudio);exit;
if(empty($type)){
@@ -57,10 +57,10 @@ if($advancedCustomUser->showAudioTab){
}
}
//var_dump($uploadedArticles);exit;
-$uploadedVideos = array();
+$uploadedVideos = [];
$uploadedTotalVideos = Video::getTotalVideos($status, $user_id, !isToHidePrivateVideos(), $showUnlisted, true, false, $type);
if(!empty($uploadedTotalVideos)){
- $uploadedVideos = Video::getAllVideos($status, $user_id, !isToHidePrivateVideos(), array(), false, $showUnlisted, true, false, null, $type);
+ $uploadedVideos = Video::getAllVideos($status, $user_id, !isToHidePrivateVideos(), [], false, $showUnlisted, true, false, null, $type);
}
TimeLogEnd($timeLog, __LINE__);
$totalPages = ceil($uploadedTotalVideos / $rowCount);
@@ -309,7 +309,7 @@ if($advancedCustomUser->showChannelLiveTab){
showChannelHomeTab) {
if (!empty($_GET['current'])) { // means you are paging the Videos tab
$active = '';
@@ -442,7 +442,7 @@ if($advancedCustomUser->showChannelLiveTab){
-
diff --git a/view/ddosCaptcha.php b/view/ddosCaptcha.php
index ea327a6c9a..2716bc1c07 100644
--- a/view/ddosCaptcha.php
+++ b/view/ddosCaptcha.php
@@ -55,10 +55,10 @@ if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
$ip = $_SERVER['REMOTE_ADDR'];
}
-$byPassCaptcha = array(
+$byPassCaptcha = [
'/Live.on_/',
'/objects.aVideoEncoder/',
- );
+ ];
foreach($byPassCaptcha as $regExp){
if(preg_match($regExp, $_SERVER['PHP_SELF'])){
@@ -67,7 +67,7 @@ foreach($byPassCaptcha as $regExp){
}
}
-$ignoreLog = array('/view/xsendfile.php');
+$ignoreLog = ['/view/xsendfile.php'];
if(!in_array($_SERVER['PHP_SELF'], $ignoreLog) || preg_match('/(bot|spider|crawl)/i', $_SERVER['HTTP_USER_AGENT'])){
error_log("AVideo captcha {$ip} PHP_SELF={$_SERVER['PHP_SELF']} HTTP_USER_AGENT={$ua}");
}
@@ -101,7 +101,7 @@ if(!empty($_GET['captcha'])){
Captcha
-
+
diff --git a/view/forbiddenPage.php b/view/forbiddenPage.php
index d684f1160a..f733b24629 100644
--- a/view/forbiddenPage.php
+++ b/view/forbiddenPage.php
@@ -31,7 +31,7 @@ $global['isForbidden'] = true;
if (!empty($_REQUEST['unlockPassword'])) {
$value = $_REQUEST['unlockPassword'];
}
- echo getInputPassword('unlockPassword', 'class="form-control" value="' . $value . '"', __('Unlock Password'));
+ echo getInputPassword('unlockPassword', 'class="form-control" value="' . $value . '"', __('Unlock Password'));
?>
diff --git a/view/include/categoryTop.php b/view/include/categoryTop.php
index e0d894b05f..e5d2e80cb0 100644
--- a/view/include/categoryTop.php
+++ b/view/include/categoryTop.php
@@ -15,7 +15,7 @@ if (!empty($_GET['catName'])) {
$photo = Category::getCategoryPhotoPath($categories_id);
$background = Category::getCategoryBackgroundPath($categories_id);
-$data = array('id'=>$categories_id);
+$data = ['id'=>$categories_id];
?>
diff --git a/view/index.php b/view/index.php
index 8c4175110d..f56cb92c96 100644
--- a/view/index.php
+++ b/view/index.php
@@ -78,12 +78,12 @@ $postURL = addQueryStringParameter($postURL, 'inMainIframe', 1);
-
+
diff --git a/view/managerVideosLight_image.php b/view/managerVideosLight_image.php
index 659788815d..10501bb526 100644
--- a/view/managerVideosLight_image.php
+++ b/view/managerVideosLight_image.php
@@ -29,7 +29,7 @@ echo $croppie1['html'];
?>
-
+