From 76010bb5cf06b1d83a36422588cb2dc608579d8d Mon Sep 17 00:00:00 2001 From: MicroVB INC Date: Fri, 18 Mar 2016 07:57:22 -0400 Subject: [PATCH] Corrected php notice in XHR file manager Wrapped `$ftpSite` in `isset()` where $ftpSite was a part of a condition for existence testing and was using the simplified mode for the check. The simplified mode resulted in the following notice being produced when no data was present in the `$ftpSite` variable. > PHP Notice: Undefined variable: ftpSite in /var/www/html/ice/lib/file-control-xhr.php on line 518 While the error pertains specifically to line 518, this adjustment was applied to all condition checks on this variable. --- lib/file-control-xhr.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/file-control-xhr.php b/lib/file-control-xhr.php index f6d4daa..0b313d1 100644 --- a/lib/file-control-xhr.php +++ b/lib/file-control-xhr.php @@ -512,7 +512,7 @@ if (!$error && $_GET['action']=="save") { // ========== if (!$error && $_GET['action']=="newFolder") { - if (!$demoMode && ($ftpSite || is_writable($docRoot.$fileLoc))) { + if (!$demoMode && (isset($ftpSite) || is_writable($docRoot.$fileLoc))) { $updateFM = false; // FTP if (isset($ftpSite)) { @@ -555,7 +555,7 @@ if (!$error && $_GET['action']=="move") { $tgtDir = $docRoot.$fileLoc."/".$fileName; } if ($srcDir != $tgtDir && $fileLoc != "") { - if (!$demoMode && ($ftpSite || is_writable($srcDir))) { + if (!$demoMode && (isset($ftpSite) || is_writable($srcDir))) { $updateFM = false; // FTP if (isset($ftpSite)) { @@ -597,7 +597,7 @@ if (!$error && $_GET['action']=="move") { // ================== if (!$error && $_GET['action']=="rename") { - if (!$demoMode && ($ftpSite || is_writable($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName']))))) { + if (!$demoMode && (isset($ftpSite) || is_writable($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName']))))) { $updateFM = false; // FTP if (isset($ftpSite)) { @@ -871,7 +871,7 @@ if (!isset($ftpSite) && !$error && $_GET['action']=="getRemoteFile") { // ======================= if (!$error && $_GET['action']=="perms") { - if (!$demoMode && ($ftpSite || is_writable($file))) { + if (!$demoMode && (isset($ftpSite) || is_writable($file))) { $updateFM = false; // FTP if (isset($ftpSite)) { @@ -968,4 +968,4 @@ echo '{ "errorMsg" : "'.$errorMsg.'" } }'; -?> \ No newline at end of file +?>