mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-06-18 02:59:27 +00:00
setting version to 0 will retrieve the latest version
This commit is contained in:
parent
dfb0ca25bd
commit
858552b743
|
@ -44,11 +44,14 @@ if ($document->getAccessMode($user) < M_READ) {
|
||||||
if(isset($_GET["version"])) {
|
if(isset($_GET["version"])) {
|
||||||
$version = $_GET["version"];
|
$version = $_GET["version"];
|
||||||
|
|
||||||
if (!isset($version) || !is_numeric($version) || intval($version)<1) {
|
if (!is_numeric($version)) {
|
||||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version"));
|
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version"));
|
||||||
}
|
}
|
||||||
|
|
||||||
$content = $document->getContentByVersion($version);
|
if(intval($version)<1)
|
||||||
|
$content = $document->getLatestContent();
|
||||||
|
else
|
||||||
|
$content = $document->getContentByVersion($version);
|
||||||
|
|
||||||
if (!is_object($content)) {
|
if (!is_object($content)) {
|
||||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version"));
|
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version"));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user