diff --git a/lib/zin/wg/history/v1.php b/lib/zin/wg/history/v1.php index 782c70ba10..f87f24c8dd 100644 --- a/lib/zin/wg/history/v1.php +++ b/lib/zin/wg/history/v1.php @@ -83,9 +83,13 @@ class history extends wg } if(empty($actions)) { - $actions = data('actions'); - if(empty($actions) && !empty($objectID)) $actions = $app->loadTarget('action')->getList($objectType, $objectID); - if(!empty($actions)) $actions = $app->loadTarget('action')->buildActionList($actions, $users, (bool)$this->prop('commentBtn')); + static $actions; + if(empty($actions)) + { + $actions = data('actions'); + if(empty($actions) && !empty($objectID)) $actions = $app->loadTarget('action')->getList($objectType, $objectID); + if(!empty($actions)) $actions = $app->loadTarget('action')->buildActionList($actions, $users, (bool)$this->prop('commentBtn')); + } $this->setProp('actions', $actions); } } diff --git a/module/file/model.php b/module/file/model.php index 772ffa2d99..c2ee2dec9b 100755 --- a/module/file/model.php +++ b/module/file/model.php @@ -569,10 +569,14 @@ class fileModel extends model $content = (string)$content; if(empty($content)) return $content; - $readLinkReg = str_replace(array('%fileID%', '/', '.', '?'), array('[0-9]+', '\/', '\.', '\?'), helper::createLink('file', 'read', 'fileID=(%fileID%)', '\w+')); + static $fileLink, $imageLink; + if(empty($fileLink)) $fileLink = helper::createLink('file', 'read', 'fileID=(%fileID%)', '\w+'); + if(empty($imageLink)) $imageLink = helper::createLink('file', 'read', "fileID=$1", "$3"); + + $readLinkReg = str_replace(array('%fileID%', '/', '.', '?'), array('[0-9]+', '\/', '\.', '\?'), $fileLink); $content = preg_replace('/ src="(' . $readLinkReg . ')" /', ' onload="setImageSize(this,' . $maxSize . ')" src="$1" ', $content); - $content = preg_replace('/ src="{([0-9]+)(\.(\w+))?}" /', ' onload="setImageSize(this,' . $maxSize . ')" src="' . helper::createLink('file', 'read', "fileID=$1", "$3") . '" ', $content); + $content = preg_replace('/ src="{([0-9]+)(\.(\w+))?}" /', ' onload="setImageSize(this,' . $maxSize . ')" src="' . $imageLink . '" ', $content); return str_replace(' src="data/upload', ' onload="setImageSize(this,' . $maxSize . ')" src="data/upload', $content); }