Inline images in formatted case log & descriptions: beta version fixperms js The inline images are now no longer stored stored as Attachments but using a specific object InlineImage...

SVN:trunk[3926]
This commit is contained in:
Denis Flaven
2016-02-25 15:06:04 +00:00
parent 9c16b08e22
commit 608e94a613
107 changed files with 4676 additions and 196 deletions

View File

@@ -295,18 +295,18 @@ class HTMLDOMSanitizer extends HTMLSanitizer
}
/**
* Add an extra attribute data-att-id for images which are based on an actual attachment
* Add an extra attribute data-img-id for images which are based on an actual InlineImage
* so that we can later reconstruct the full "src" URL when needed
* @param DOMNode $oElement
*/
protected function ProcessImage(DOMNode $oElement)
{
$sSrc = $oElement->getAttribute('src');
$sDownloadUrl = str_replace(array('.', '?'), array('\.', '\?'), ATTACHMENT_DOWNLOAD_URL); // Escape . and ?
$sDownloadUrl = str_replace(array('.', '?'), array('\.', '\?'), INLINEIMAGE_DOWNLOAD_URL); // Escape . and ?
$sUrlPattern = '|'.$sDownloadUrl.'([0-9]+)|';
if (preg_match($sUrlPattern, $sSrc, $aMatches))
{
$oElement->setAttribute('data-att-id', $aMatches[1]);
$oElement->setAttribute('data-img-id', $aMatches[1]);
}
}