mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-09 13:06:14 +00:00
trim name passed to addDocumentCategory() and check if != ''
This commit is contained in:
parent
3ed0854e13
commit
59c16b3ce4
|
@ -2431,10 +2431,12 @@ class SeedDMS_Core_DMS {
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
function addDocumentCategory($name) { /* {{{ */
|
function addDocumentCategory($name) { /* {{{ */
|
||||||
if (is_object($this->getDocumentCategoryByName($name))) {
|
if(!trim($name))
|
||||||
|
return false;
|
||||||
|
if (is_object($this->getDocumentCategoryByName(trim($name)))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$queryStr = "INSERT INTO `tblCategory` (`name`) VALUES (".$this->db->qstr($name).")";
|
$queryStr = "INSERT INTO `tblCategory` (`name`) VALUES (".$this->db->qstr(trim($name)).")";
|
||||||
if (!$this->db->getResult($queryStr))
|
if (!$this->db->getResult($queryStr))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user