mirror of
https://github.com/Squidly271/community.applications.git
synced 2025-06-03 14:52:13 +08:00
php
This commit is contained in:
parent
73de002c3f
commit
b5760d275c
Binary file not shown.
@ -2,8 +2,8 @@ e23a1f42a98de86535c5c42c243a8893 ./Apps.page
|
||||
0987a65d249dbec3267b0f4a02aa975a ./CA_notices.page
|
||||
2c2a1b7d148fe51ee38813d1a0e71589 ./ca_settings.page
|
||||
01ed7990078dee7cecfeda9a4e49377e ./default.cfg
|
||||
4c9386392d7e0861c0fdee6d6926c4ae ./include/exec.php
|
||||
b840de05b16d77ad0886a61ce4cf9512 ./include/helpers.php
|
||||
868fa54739e6859b8675f856508984eb ./include/exec.php
|
||||
1ad9fa5c1cefd01324e1bbbeb33b6a63 ./include/helpers.php
|
||||
343e1d26129551fc142b09b5d6e10503 ./include/paths.php
|
||||
7234caf6800479df03abb222aaedaca5 ./javascript/libraries.js
|
||||
71f911a818d88d3d567f8a2898094ee2 ./README.md
|
||||
@ -22,5 +22,5 @@ a1cb6e1930f2ad689ce9e7fc2e39c846 ./scripts/notices.php
|
||||
52355989c2bec01cfd55fe619588a033 ./scripts/updatePluginSupport.php
|
||||
b4e3802d0ddeaf20cdd1b001dab3eeb8 ./skins/Narrow/css.php
|
||||
89953dddd75450915c0294a276d331bb ./skins/Narrow/skin.html
|
||||
22e318cd3225525e9f6b30e1e8ea33c3 ./skins/Narrow/skin.php
|
||||
75ca078d7f144ecd1cb00bc7bc119400 ./skins/Narrow/skin.php
|
||||
c26b187a50c966adff7bfb9cab6fca16 ./event/disks_mounted
|
||||
|
@ -244,6 +244,7 @@ function DownloadApplicationFeed() {
|
||||
|
||||
$o['CategoryList'] = $o['CategoryList'] ?? [];
|
||||
if ( $o['CategoryList'] ) {
|
||||
$o['Category'] = $o['Category'] ?? "";
|
||||
foreach ($o['CategoryList'] as $cat) {
|
||||
$cat = str_replace("-",":",$cat);
|
||||
if ( ! strpos($cat,":") )
|
||||
@ -252,9 +253,7 @@ function DownloadApplicationFeed() {
|
||||
}
|
||||
}
|
||||
|
||||
$o['Category'] = $o['Category'] ?? null;
|
||||
if ( $o['Category'] === null )
|
||||
$o['Category'] = "";
|
||||
$o['Category'] = $o['Category'] ?? "";
|
||||
$o['Category'] = trim($o['Category']);
|
||||
if ( ! $o['Category'] )
|
||||
$o['Category'] = "Other:";
|
||||
@ -293,22 +292,23 @@ function DownloadApplicationFeed() {
|
||||
if ( $o['RequiresFile'] ?? null) $o['RequiresFile'] = trim($o['RequiresFile']);
|
||||
if ( $o['Requires'] ?? null) $o['Requires'] = trim($o['Requires']);
|
||||
|
||||
$des = $o['OriginalOverview'] ?? $o['Overview'];
|
||||
$des = $o['Language'] ? $o['Description'] : $des;
|
||||
if ( ! $des && $o['Description'] ) $des = $o['Description'];
|
||||
if ( ! $o['Language'] ) {
|
||||
$des = $o['OriginalOverview'] ?? ($o['Overview']??null);
|
||||
$des = ($o['Language']??null) ? $o['Description'] : $des;
|
||||
if ( ! $des && $o['Description'] )
|
||||
$des = $o['Description'];
|
||||
if ( ! ($o['Language']??null) ) {
|
||||
$des = str_replace(["[","]"],["<",">"],$des);
|
||||
$des = str_replace("\n"," ",$des);
|
||||
$des = html_entity_decode($des);
|
||||
}
|
||||
|
||||
if ( $o['PluginURL'] ) {
|
||||
if ( $o['PluginURL'] ?? null ) {
|
||||
$o['Author'] = $o['PluginAuthor'];
|
||||
$o['Repository'] = $o['PluginURL'];
|
||||
}
|
||||
|
||||
$o['Blacklist'] = $o['CABlacklist'] ? true : $o['Blacklist'];
|
||||
$o['MinVer'] = max([$o['MinVer'],$o['UpdateMinVer']]);
|
||||
$o['Blacklist'] = ($o['CABlacklist']??null) ? true : ($o['Blacklist']??false);
|
||||
$o['MinVer'] = max([($o['MinVer']??null),($o['UpdateMinVer']??null)]);
|
||||
$tag = explode(":",$o['Repository']);
|
||||
if (! isset($tag[1]))
|
||||
$tag[1] = "latest";
|
||||
@ -321,7 +321,7 @@ function DownloadApplicationFeed() {
|
||||
$o = fixTemplates($o);
|
||||
if ( ! $o ) continue;
|
||||
|
||||
if ( is_array($o['trends']) && count($o['trends']) > 1 ) {
|
||||
if ( is_array($o['trends']??null) && count($o['trends']) > 1 ) {
|
||||
$o['trendDelta'] = round(end($o['trends']) - $o['trends'][0],4);
|
||||
$o['trendAverage'] = round(array_sum($o['trends'])/count($o['trends']),4);
|
||||
}
|
||||
@ -330,10 +330,10 @@ function DownloadApplicationFeed() {
|
||||
$o['Category'] = str_replace("Status:Stable","",$o['Category']);
|
||||
$myTemplates[$i] = $o;
|
||||
|
||||
if ( ! $o['Official'] ) {
|
||||
if ( ! $o['DonateText'] && ($ApplicationFeed['repositories'][$o['RepoName']]['DonateText'] ?? false) )
|
||||
if ( ! ($o['Official']??null) ) {
|
||||
if ( ! ($o['DonateText']??null) && ($ApplicationFeed['repositories'][$o['RepoName']]['DonateText'] ?? false) )
|
||||
$o['DonateText'] = $ApplicationFeed['repositories'][$o['RepoName']]['DonateText'];
|
||||
if ( ! $o['DonateLink'] && ($ApplicationFeed['repositories'][$o['RepoName']]['DonateLink'] ?? false) )
|
||||
if ( ! ($o['DonateLink']??null) && ($ApplicationFeed['repositories'][$o['RepoName']]['DonateLink'] ?? false) )
|
||||
$o['DonateLink'] = $ApplicationFeed['repositories'][$o['RepoName']]['DonateLink'];
|
||||
} else {
|
||||
$o['DonateText'] = $o['OfficialDonateText'] ?? null;
|
||||
@ -343,8 +343,8 @@ function DownloadApplicationFeed() {
|
||||
$ApplicationFeed['repositories'][$o['RepoName']]['trending'] = $ApplicationFeed['repositories'][$o['RepoName']]['trending'] ?? 0;
|
||||
|
||||
$ApplicationFeed['repositories'][$o['RepoName']]['downloads']++;
|
||||
$ApplicationFeed['repositories'][$o['RepoName']]['trending'] += $o['trending'];
|
||||
if ( ! $o['ModeratorComment'] == "Duplicated Template" ) {
|
||||
$ApplicationFeed['repositories'][$o['RepoName']]['trending'] += $o['trending']??null;
|
||||
if ( ! ($o['ModeratorComment']??null) == "Duplicated Template" ) {
|
||||
if ( $ApplicationFeed['repositories'][$o['RepoName']]['FirstSeen'] ?? false) {
|
||||
if ( $o['FirstSeen'] < $ApplicationFeed['repositories'][$o['RepoName']]['FirstSeen'])
|
||||
$ApplicationFeed['repositories'][$o['RepoName']]['FirstSeen'] = $o['FirstSeen'];
|
||||
@ -352,7 +352,7 @@ function DownloadApplicationFeed() {
|
||||
$ApplicationFeed['repositories'][$o['RepoName']]['FirstSeen'] = $o['FirstSeen'];
|
||||
}
|
||||
}
|
||||
if ( is_array($o['Branch']) ) {
|
||||
if ( is_array($o['Branch']??null) ) {
|
||||
if ( ! isset($o['Branch'][0]) ) {
|
||||
$tmp = $o['Branch'];
|
||||
unset($o['Branch']);
|
||||
@ -369,8 +369,8 @@ function DownloadApplicationFeed() {
|
||||
$subBranch['Path'] = $caPaths['templates-community']."/".$i.".xml";
|
||||
$subBranch['Displayable'] = false;
|
||||
$subBranch['ID'] = $i;
|
||||
$subBranch['Overview'] = $o['OriginalOverview'] ?: $o['Overview'];
|
||||
$subBranch['Description'] = $o['OriginalDescription'] ?: $o['Description'];
|
||||
$subBranch['Overview'] = $o['OriginalOverview'] ?? $o['Overview'];
|
||||
$subBranch['Description'] = $o['OriginalDescription'] ?? ($o['Description']??null);
|
||||
$replaceKeys = array_diff(array_keys($branch),["Tag","TagDescription"]);
|
||||
foreach ($replaceKeys as $key) {
|
||||
$subBranch[$key] = $branch[$key];
|
||||
@ -383,12 +383,12 @@ function DownloadApplicationFeed() {
|
||||
unset($o['Branch']);
|
||||
$myTemplates[$o['ID']] = $o;
|
||||
$i = ++$i;
|
||||
if ( $o['OriginalOverview'] ) {
|
||||
if ( $o['OriginalOverview']??null ) {
|
||||
$o['Overview'] = $o['OriginalOverview'];
|
||||
unset($o['OriginalOverview']);
|
||||
unset($o['Description']);
|
||||
}
|
||||
if ( $o['OriginalDescription'] ) {
|
||||
if ( $o['OriginalDescription']??null ) {
|
||||
$o['Description'] = $o['OriginalDescription'];
|
||||
unset($o['OriginalDescription']);
|
||||
}
|
||||
@ -922,7 +922,7 @@ function get_content() {
|
||||
|
||||
$name = $template['Name'];
|
||||
|
||||
if ( $template['Plugin'] && file_exists("/var/log/plugins/".basename($template['PluginURL'])) )
|
||||
if ( ($template['Plugin']??null) && file_exists("/var/log/plugins/".basename($template['PluginURL'])) )
|
||||
$template['InstallPath'] = $template['PluginURL'];
|
||||
|
||||
$template['NewApp'] = $newApp;
|
||||
@ -1290,7 +1290,7 @@ function previous_apps() {
|
||||
if ( $installed == "true" || $installed == "action" ) {
|
||||
if ( ! $filter || $filter == "plugins" ) {
|
||||
foreach ($file as $template) {
|
||||
if ( ! $template['Plugin'] ) continue;
|
||||
if ( ! ($template['Plugin']??null) ) continue;
|
||||
|
||||
$filename = pathinfo($template['Repository'],PATHINFO_BASENAME);
|
||||
|
||||
|
@ -221,9 +221,9 @@ function searchArray($array,$key,$value,$startingIndex=0) {
|
||||
function fixTemplates($template) {
|
||||
global $statistics, $caSettings;
|
||||
|
||||
if ( ! $template['MinVer'] ) $template['MinVer'] = $template['Plugin'] ? "6.1" : "6.0";
|
||||
if ( ! $template['Date'] ) $template['Date'] = (is_numeric($template['DateInstalled'])) ? $template['DateInstalled'] : 0;
|
||||
$template['Date'] = max($template['Date'],$template['FirstSeen']);
|
||||
if ( ! $template['MinVer'] ) $template['MinVer'] = ($template['Plugin']??false) ? "6.1" : "6.0";
|
||||
if ( ! ($template['Date']??null) ) $template['Date'] = (is_numeric($template['DateInstalled']??null)) ? $template['DateInstalled'] : 0;
|
||||
$template['Date'] = max($template['Date']??null,$template['FirstSeen']??null);
|
||||
if ($template['Date'] == 1) $template['Date'] = null;
|
||||
if ( ($template['Date'] == $template['FirstSeen']) && ( $template['FirstSeen'] >= 1538357652 )) {# 1538357652 is when the new appfeed first started
|
||||
$template['BrandNewApp'] = true;
|
||||
@ -231,14 +231,14 @@ function fixTemplates($template) {
|
||||
}
|
||||
|
||||
# fix where template author includes <Blacklist> or <Deprecated> entries in template (CA used booleans, but appfeed winds up saying "FALSE" which equates to be true
|
||||
$template['Deprecated'] = filter_var($template['Deprecated'],FILTER_VALIDATE_BOOLEAN);
|
||||
$template['Blacklist'] = filter_var($template['Blacklist'],FILTER_VALIDATE_BOOLEAN);
|
||||
$template['Deprecated'] = filter_var($template['Deprecated']??null,FILTER_VALIDATE_BOOLEAN);
|
||||
$template['Blacklist'] = filter_var($template['Blacklist']??null,FILTER_VALIDATE_BOOLEAN);
|
||||
|
||||
if ( $template['DeprecatedMaxVer'] && version_compare($caSettings['unRaidVersion'],$template['DeprecatedMaxVer'],">") )
|
||||
if ( ($template['DeprecatedMaxVer']??null) && version_compare($caSettings['unRaidVersion'],$template['DeprecatedMaxVer'],">") )
|
||||
$template['Deprecated'] = true;
|
||||
|
||||
if ( version_compare($caSettings['unRaidVersion'],"6.10.0-beta4",">") ) {
|
||||
if ( $template['Config'] ) {
|
||||
if ( $template['Config']??null ) {
|
||||
if ( $template['Config']['@attributes'] ?? false ) {
|
||||
if (preg_match("/^(Container Path:|Container Port:|Container Label:|Container Variable:|Container Device:)/",$template['Config']['@attributes']['Description']) ) {
|
||||
$template['Config']['@attributes']['Description'] = "";
|
||||
|
@ -548,7 +548,7 @@ function getPopupDescriptionSkin($appNumber) {
|
||||
}
|
||||
$template = $file[$index];
|
||||
}
|
||||
|
||||
$template = addMissingVars($template);
|
||||
if ( ! $template['Blacklist'] ) {
|
||||
if ( isset($extraBlacklist[$template['Repository']]) ) {
|
||||
$template['Blacklist'] = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user