pm2731
This commit is contained in:
@@ -968,6 +968,18 @@ class Processes
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($oData->taskExtraProperties)) {
|
||||
foreach ($oData->taskExtraProperties as $key => $value) {
|
||||
$record = $value;
|
||||
|
||||
if (isset($map[$record["OBJ_UID"]])) {
|
||||
$newUid = $map[$record["OBJ_UID"]];
|
||||
|
||||
$oData->taskExtraProperties[$key]["OBJ_UID"] = $newUid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($oData->webEntry)) {
|
||||
foreach ($oData->webEntry as $key => $value) {
|
||||
@@ -3745,6 +3757,22 @@ class Processes
|
||||
|
||||
// for public files
|
||||
$PUBLIC_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . SYS_SYS . PATH_SEP . 'public' . PATH_SEP . $data->process['PRO_UID'];
|
||||
|
||||
//Get WebEntry file names
|
||||
$arrayWebEntryFile = array();
|
||||
|
||||
if (is_dir($PUBLIC_ROOT_PATH)) {
|
||||
if ($dirh = opendir($PUBLIC_ROOT_PATH)) {
|
||||
while (($file = readdir($dirh)) !== false) {
|
||||
if (preg_match("/^(.+)Post\.php$/", $file, $arrayMatch)) {
|
||||
$arrayWebEntryFile[] = $arrayMatch[1] . ".php";
|
||||
$arrayWebEntryFile[] = $arrayMatch[1] . "Post.php";
|
||||
}
|
||||
}
|
||||
|
||||
closedir($dirh);
|
||||
}
|
||||
}
|
||||
|
||||
//if this process have any mailfile
|
||||
if (is_dir( $PUBLIC_ROOT_PATH )) {
|
||||
@@ -3753,6 +3781,10 @@ class Processes
|
||||
foreach ($file_list as $filename) {
|
||||
// verify if this filename is a valid file, because it could be . or .. on *nix systems
|
||||
if ($filename != '.' && $filename != '..') {
|
||||
if (in_array($filename, $arrayWebEntryFile)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (@is_readable( $PUBLIC_ROOT_PATH . PATH_SEP . $filename )) {
|
||||
$sFileName = $PUBLIC_ROOT_PATH . PATH_SEP . $filename;
|
||||
if (file_exists( $sFileName )) {
|
||||
@@ -4184,6 +4216,28 @@ class Processes
|
||||
}
|
||||
|
||||
if (trim( $sIdentifier ) == 'PUBLIC') {
|
||||
//Get WebEntry file names
|
||||
$arrayWebEntryFile = array();
|
||||
|
||||
$fh = fopen($pmFilename, "rb");
|
||||
$contents = fread($fh, intval(fread($fh, 9))); //Reading string $oData
|
||||
|
||||
while (!feof($fh)) {
|
||||
$fsFileName = intval(fread($fh, 9)); //Reading the size of $filename
|
||||
|
||||
if ($fsFileName > 0) {
|
||||
$sFileName = fread($fh, $fsFileName); //Reading filename string
|
||||
|
||||
if (preg_match("/^(.+)Post\.php$/", $sFileName, $arrayMatch)) {
|
||||
$arrayWebEntryFile[] = $arrayMatch[1] . ".php";
|
||||
$arrayWebEntryFile[] = $arrayMatch[1] . "Post.php";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fclose($fh);
|
||||
|
||||
//Public files
|
||||
$sIdentifier = 1;
|
||||
while (! feof( $fp ) && is_numeric( $sIdentifier )) {
|
||||
$sIdentifier = fread( $fp, 9 ); //reading the size of $filename
|
||||
@@ -4196,6 +4250,11 @@ class Processes
|
||||
if ($fsContent > 0) {
|
||||
$fileContent = fread( $fp, $fsContent ); //reading string $XmlContent
|
||||
$newFileName = $pathPublic . $sFileName;
|
||||
|
||||
if (in_array($sFileName, $arrayWebEntryFile)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$bytesSaved = @file_put_contents( $newFileName, $fileContent );
|
||||
if ($bytesSaved != $fsContent) {
|
||||
throw (new Exception( 'Error writing Public file in directory : ' . $pathPublic ));
|
||||
|
||||
Reference in New Issue
Block a user