Skip to content

Commit

Permalink
Merge branch '2.0' into 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
robbieaverill committed Dec 7, 2017
2 parents 99ee72e + bcf2ac9 commit b7a3a1d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions code/cms/DMSDocumentAddController.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,14 @@ public function Backlink()
return Controller::join_links(
$modelAdmin->Link('DMSDocumentSet'),
'EditForm/field/DMSDocumentSet/item',
$this->getRequest()->getVar('dsid'),
(int) $this->getRequest()->getVar('dsid'),
'edit'
);
}
return $modelAdmin->Link();
}

return $this->getPageEditLink($this->currentPageID(), $this->getRequest()->getVar('dsid'));
return $this->getPageEditLink($this->currentPageID(), (int) $this->getRequest()->getVar('dsid'));
}

/**
Expand All @@ -212,7 +212,7 @@ protected function getPageEditLink($pageId, $documentSetId)
return Controller::join_links(
CMSPageEditController::singleton()->getEditForm($pageId)->FormAction(),
'field/Document Sets/item',
$documentSetId
(int) $documentSetId
);
}

Expand Down
3 changes: 3 additions & 0 deletions code/model/DMSDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -1322,6 +1322,9 @@ public function getActionTaskHtml()
. '<ul>';

foreach ($this->actionTasks as $panelKey => $title) {
$panelKey = Convert::raw2xml($panelKey);
$title = Convert::raw2xml($title);

$html .= '<li class="ss-ui-button dmsdocument-action" data-panel="' . $panelKey . '">'
. _t('DMSDocument.ACTION_' . strtoupper($panelKey), $title)
. '</li>';
Expand Down
3 changes: 2 additions & 1 deletion code/model/DMSDocument_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,15 @@ public function index(SS_HTTPRequest $request)
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$mime = finfo_file($finfo, $path);
} elseif (is_executable($fileBin)) {
$path = escapeshellarg($path);
// try to use the system tool
$mime = `$fileBin -i -b $path`;
$mime = explode(';', $mime);
$mime = trim($mime[0]);
} else {
// make do with what we have
$ext = $doc->getExtension();
if ($ext =='pdf') {
if ($ext == 'pdf') {
$mime = 'application/pdf';
} elseif ($ext == 'html' || $ext =='htm') {
$mime = 'text/html';
Expand Down

0 comments on commit b7a3a1d

Please sign in to comment.