mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
no more errors if url parameters are missing
This commit is contained in:
parent
544cc2669f
commit
902cae2804
|
@ -71,15 +71,27 @@ if( move_uploaded_file( $source_file_path, $target_file_path ) ) {
|
||||||
else
|
else
|
||||||
$keywords = '';
|
$keywords = '';
|
||||||
|
|
||||||
|
if(isset($_POST["reqversion"])) {
|
||||||
$reqversion = (int)$_POST["reqversion"];
|
$reqversion = (int)$_POST["reqversion"];
|
||||||
if ($reqversion<1) $reqversion=1;
|
if ($reqversion<1) $reqversion=1;
|
||||||
|
} else {
|
||||||
|
$reqversion = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($_POST['sequence'])) {
|
||||||
$sequence = $_POST["sequence"];
|
$sequence = $_POST["sequence"];
|
||||||
if (!is_numeric($sequence)) {
|
if (!is_numeric($sequence)) {
|
||||||
$sequence = 1;
|
$sequence = 1;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$sequence = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($_POST["expires"])) {
|
||||||
$expires = ($_POST["expires"] == "true") ? mktime(0,0,0, intval($_POST["expmonth"]), intval($_POST["expday"]), intval($_POST["expyear"])) : false;
|
$expires = ($_POST["expires"] == "true") ? mktime(0,0,0, intval($_POST["expmonth"]), intval($_POST["expday"]), intval($_POST["expyear"])) : false;
|
||||||
|
} else {
|
||||||
|
$expires = false;
|
||||||
|
}
|
||||||
|
|
||||||
// Get the list of reviewers and approvers for this document.
|
// Get the list of reviewers and approvers for this document.
|
||||||
$reviewers = array();
|
$reviewers = array();
|
||||||
|
@ -162,19 +174,21 @@ if( move_uploaded_file( $source_file_path, $target_file_path ) ) {
|
||||||
if (is_bool($lastDotIndex) && !$lastDotIndex) $fileType = ".";
|
if (is_bool($lastDotIndex) && !$lastDotIndex) $fileType = ".";
|
||||||
else $fileType = substr($userfilename, $lastDotIndex);
|
else $fileType = substr($userfilename, $lastDotIndex);
|
||||||
|
|
||||||
if($_POST["name"] != "")
|
if(isset($_POST["name"]) && $_POST["name"] != "")
|
||||||
$name = $_POST["name"];
|
$name = $_POST["name"];
|
||||||
else
|
else
|
||||||
$name = basename($userfilename);
|
$name = basename($userfilename);
|
||||||
|
|
||||||
$categories = preg_replace('/[^0-9,]+/', '', $_POST["categoryids"]);
|
|
||||||
$cats = array();
|
$cats = array();
|
||||||
|
if(isset($_POST["categoryids"])) {
|
||||||
|
$categories = preg_replace('/[^0-9,]+/', '', $_POST["categoryids"]);
|
||||||
if($categories) {
|
if($categories) {
|
||||||
$catids = explode(',', $categories);
|
$catids = explode(',', $categories);
|
||||||
foreach($catids as $catid) {
|
foreach($catids as $catid) {
|
||||||
$cats[] = $dms->getDocumentCategory($catid);
|
$cats[] = $dms->getDocumentCategory($catid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$res = $folder->addDocument($name, $comment, $expires, $user, $keywords,
|
$res = $folder->addDocument($name, $comment, $expires, $user, $keywords,
|
||||||
$cats, $userfiletmp, basename($userfilename),
|
$cats, $userfiletmp, basename($userfilename),
|
||||||
$fileType, $userfiletype, $sequence,
|
$fileType, $userfiletype, $sequence,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user