mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +00:00
check if attributes are posted
This commit is contained in:
parent
cb7ca87c6c
commit
9df1a1eb08
|
@ -168,16 +168,20 @@ if ($_FILES['userfile']['error'] == 0) {
|
|||
}
|
||||
}
|
||||
|
||||
$attributes = $_POST["attributes"];
|
||||
foreach($attributes as $attrdefid=>$attribute) {
|
||||
$attrdef = $dms->getAttributeDefinition($attrdefid);
|
||||
if($attribute) {
|
||||
if($attrdef->getRegex()) {
|
||||
if(!preg_match($attrdef->getRegex(), $attribute)) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => $folder->getName())),getMLText("attr_no_regex_match"));
|
||||
if(isset($_POST["attributes"]) && $_POST["attributes"]) {
|
||||
$attributes = $_POST["attributes"];
|
||||
foreach($attributes as $attrdefid=>$attribute) {
|
||||
$attrdef = $dms->getAttributeDefinition($attrdefid);
|
||||
if($attribute) {
|
||||
if($attrdef->getRegex()) {
|
||||
if(!preg_match($attrdef->getRegex(), $attribute)) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => $folder->getName())),getMLText("attr_no_regex_match"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$attributes = array();
|
||||
}
|
||||
|
||||
$contentResult=$document->addContent($comment, $user, $userfiletmp, basename($userfilename), $fileType, $userfiletype, $reviewers, $approvers, $version=0, $attributes);
|
||||
|
|
Loading…
Reference in New Issue
Block a user