This commit is contained in:
Squidly271 2022-12-16 14:52:21 -05:00
parent 16398d7893
commit f481131a4e
5 changed files with 20 additions and 14 deletions

View File

@ -20,6 +20,12 @@ $cfg['dockerSearch'] = "yes";
$cfg['unRaidVersion'] = $var['version'];
$caSettings = $cfg;
/* UNCOMMENT once the WebGUI is completely PHP8 compliant. Especially dockerMan
if ($caSettings['dev'] == "yes")
error_reporting(E_ALL);
*/
require_once "$docroot/plugins/dynamix.docker.manager/include/DockerClient.php";
require_once "$docroot/plugins/$plugin/include/paths.php";
require_once "$docroot/plugins/$plugin/include/helpers.php";
@ -57,7 +63,7 @@ $nchanCom = version_compare($unRaidSettings['version'],"6.10.3",">");
// Check md5's of files
exec("cd /usr/local/emhttp/plugins/$plugin/ && md5sum -c ca.md5",$output,$md5Error);
$previousLocale = $_COOKIE["locale"];
$previousLocale = $_COOKIE["locale"] ?? "";
switch ($theme) {
case 'black':
@ -93,7 +99,7 @@ if ( is_file($caPaths['addConverted']) ) {
$date = (date("n/d"));
$startupDisplayed = is_file($caPaths['startupDisplayed']) ? "true" : "false";
if ( $startupDisplayed == "true" && $_COOKIE['ca_languageSwitch'] ) {
if ( $startupDisplayed == "true" && ($_COOKIE['ca_languageSwitch'] ?? false) ) {
$killCookie = "true";
}
@ -2233,7 +2239,7 @@ function postNoSpin(options,callback) {
alert("<?tr("You have been logged out")?>");
window.location.reload();
} else {
$("#templates_content").html(sprintf(tr("Something really wrong went on during %s"),options.action)+"<br><?tr("Post the ENTIRE contents of this message in the Community Applications Support Thread")?><br><br>OS: <?=$unRaidSettings['version']?> <?=$md5Error ? "<br>Modified CA" : ""?><br>Browser: <?=$_SERVER['HTTP_USER_AGENT']?><br>Language: <?=$_SESSION['locale']?><br><br>"+retval.escapeHTML());
$("#templates_content").html(sprintf(tr("Something really wrong went on during %s"),options.action)+"<br><?tr("Post the ENTIRE contents of this message in the Community Applications Support Thread")?><br><br>OS: <?=$unRaidSettings['version']?> <?=$md5Error ? "<br>Modified CA" : ""?><br>Browser: <?=$_SERVER['HTTP_USER_AGENT']?><br>Language: <?=($_SESSION['locale'] ?? null)?><br><br>"+retval.escapeHTML());
throw new Error("Something went badly wrong!"+options.action);
}
}
@ -2298,7 +2304,7 @@ function post(options,callback) {
alert("<?tr("You have been logged out")?>");
window.location.reload();
} else {
$("#templates_content").html(sprintf(tr("Something really wrong went on during %s"),options.action)+"<br><?tr("Post the ENTIRE contents of this message in the Community Applications Support Thread")?><br><br>OS: <?=$unRaidSettings['version']?> <?=$md5Error ? "<br>Modified CA" : ""?><br>Browser: <?=$_SERVER['HTTP_USER_AGENT']?><br>Language: <?=$_SESSION['locale']?><br><br>"+retval.escapeHTML());
$("#templates_content").html(sprintf(tr("Something really wrong went on during %s"),options.action)+"<br><?tr("Post the ENTIRE contents of this message in the Community Applications Support Thread")?><br><br>OS: <?=$unRaidSettings['version']?> <?=$md5Error ? "<br>Modified CA" : ""?><br>Browser: <?=$_SERVER['HTTP_USER_AGENT']?><br>Language: <?=($_SESSION['locale'] ?? "")?><br><br>"+retval.escapeHTML());
throw new Error("Something went badly wrong!"+options.action);
}
}
@ -2429,7 +2435,7 @@ function feedWarning(currentServer) {
}
function tr(string) {
<?if ( ! ($_SESSION['locale'] == "" || $_SESSION['locale'] == "en_US") ) : ?>
<?if ( ! ( ($_SESSION['locale'] ?? "") == "" || ($_SESSION['locale'] ?? "") == "en_US") ) : ?>
return _(string);
<?else: ?>
return string;
@ -2475,7 +2481,7 @@ function updateLanguage(language) {
function postUpdateLanguage() {
var languageUpdate = $.cookie("updateLanguage");
var currentLanguage = "<?=$_SESSION['locale']?>";
var currentLanguage = "<?=($_SESSION['locale'] ?? "")?>";
if (languageUpdate == currentLanguage)
window.location.reload();

View File

@ -1,9 +1,9 @@
253bc8277a96c67716a1376e047570ef ./Apps.page
cfefda874e2de863f14da70bafdf70e4 ./Apps.page
4e55f7483b661af21a25b677179baffe ./CA_notices.page
600469ce287cb1ed78dc6cc11675cfaf ./ca_settings.page
e8d29607ec792ddf9f6832b10ee70fdc ./default.cfg
9ffd40aedffad25c998e947faf169ad3 ./include/exec.php
3a1e5abf962bd5700e286a48c941b2c9 ./include/helpers.php
c506f75e86d9f941f11eb4c949f00424 ./include/exec.php
78d797120193602420951421f8c844ad ./include/helpers.php
8d15446d4edf60a1f4ac4493a494a301 ./include/paths.php
532fffdf939594c143e679da02bd841e ./javascript/libraries.js
71f911a818d88d3d567f8a2898094ee2 ./README.md

View File

@ -6,8 +6,6 @@
# #
###############################################################
ini_set('log_errors',TRUE);
ini_set('error_log',"/tmp/php");
ini_set('memory_limit','256M'); // REQUIRED LINE
$unRaidSettings = parse_ini_file("/etc/unraid-version");
### Translations section has to be first so that nothing else winds up caching the file(s)
@ -31,6 +29,9 @@ require_once "$docroot/webGui/include/Markdown.php";
$caSettings = parse_plugin_cfg("community.applications");
if ($caSettings['dev'] == "yes")
error_reporting(E_ALL);
$caSettings['dockerSearch'] = "yes";
$caSettings['unRaidVersion'] = $unRaidSettings['version'];
$caSettings['favourite'] = isset($caSettings['favourite']) ? str_replace("*","'",$caSettings['favourite']) : "";
@ -969,10 +970,10 @@ function force_update() {
global $caPaths;
$lastUpdatedOld = readJsonFile($caPaths['lastUpdated-old']);
debug("old feed timestamp: {$lastUpdatedOld['last_updated_timestamp']}");
debug("old feed timestamp: ".($lastUpdatedOld['last_updated_timestamp'] ?? ""));
@unlink($caPaths['lastUpdated']);
$latestUpdate = download_json($caPaths['application-feed-last-updated'],$caPaths['lastUpdated'],"",5);
if ( ! $latestUpdate['last_updated_timestamp'] )
if ( ! $latestUpdate['last_updated_timestamp'] ?? false )
$latestUpdate = download_json($caPaths['application-feed-last-updatedBackup'],$caPaths['lastUpdated'],"",5);
debug("new appfeed timestamp: {$latestUpdate['last_updated_timestamp']}");
if ( ! isset($latestUpdate['last_updated_timestamp']) ) {

View File

@ -439,7 +439,6 @@ function pluginDupe() {
function checkInstalledPlugin($template) {
global $caPaths;
debug("checkInstalledPlugin $template");
$pluginName = basename($template['PluginURL']);
if ( ! file_exists("/var/log/plugins/$pluginName") ) return false;
$dupeList = readJsonFile($caPaths['pluginDupes']);