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.
This commit is contained in:
MicroVB INC
2016-03-18 07:57:22 -04:00
parent 09fde0c3e5
commit 76010bb5cf

View File

@@ -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.'"
}
}';
?>
?>