BUG-8965: Documents download with 0 Kb SOLVED
- no se podia descargar los documentos alfresco. - se cambio eregi_ por preg_replace, para evitar el decrecated.
This commit is contained in:
@@ -219,7 +219,7 @@ function downloadDoc($alfrescoServerUrl, $pathFile, $pathFolder, $user, $pwd, $m
|
|||||||
$alfresco_url = "$alfrescoServerUrl" . PATH_SEP . "s" . PATH_SEP . "cmis" . PATH_SEP . "p" . PATH_SEP . $mainFolder . PATH_SEP . "$pathFile";
|
$alfresco_url = "$alfrescoServerUrl" . PATH_SEP . "s" . PATH_SEP . "cmis" . PATH_SEP . "p" . PATH_SEP . $mainFolder . PATH_SEP . "$pathFile";
|
||||||
$alfresco_exec = RestClient::get($alfresco_url, $user, $pwd, 'application/atom+xml');
|
$alfresco_exec = RestClient::get($alfresco_url, $user, $pwd, 'application/atom+xml');
|
||||||
$sXmlArray = $alfresco_exec->getResponse();
|
$sXmlArray = $alfresco_exec->getResponse();
|
||||||
$sXmlArray = eregi_replace("[\n|\r|\n\r]", '', $sXmlArray);
|
$sXmlArray = preg_replace("[\n|\r|\n\r]", '', $sXmlArray);
|
||||||
$xmlObject = simplexml_load_string((string) $sXmlArray);
|
$xmlObject = simplexml_load_string((string) $sXmlArray);
|
||||||
|
|
||||||
if (!isset($xmlObject->content)) {
|
if (!isset($xmlObject->content)) {
|
||||||
@@ -231,7 +231,7 @@ function downloadDoc($alfrescoServerUrl, $pathFile, $pathFolder, $user, $pwd, $m
|
|||||||
$linkContent = (string) $xmlObject->content->attributes()->src;
|
$linkContent = (string) $xmlObject->content->attributes()->src;
|
||||||
$alfresco_exec = RestClient::get($linkContent, $user, $pwd, 'application/atom+xml');
|
$alfresco_exec = RestClient::get($linkContent, $user, $pwd, 'application/atom+xml');
|
||||||
$sXmlArray = $alfresco_exec->getResponse();
|
$sXmlArray = $alfresco_exec->getResponse();
|
||||||
$content = eregi_replace("[\n|\r|\n\r]", '', $sXmlArray);
|
$content = preg_replace("[\n|\r|\n\r]", '', $sXmlArray);
|
||||||
|
|
||||||
if ('/' != substr($pathFolder, -1)) {
|
if ('/' != substr($pathFolder, -1)) {
|
||||||
$pathFolder .= '/';
|
$pathFolder .= '/';
|
||||||
|
|||||||
Reference in New Issue
Block a user