mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 08:55:54 +00:00
check if attribute is a string before using it in an sql statement
This commit is contained in:
parent
5b5ac45e21
commit
10876c6495
|
@ -1542,7 +1542,7 @@ class SeedDMS_Core_DMS {
|
|||
if(is_string($attribute))
|
||||
$attribute = array($attribute);
|
||||
$searchAttributes[] = "EXISTS (SELECT NULL FROM `tblFolderAttributes` WHERE `tblFolderAttributes`.`attrdef`=".$attrdefid." AND (`tblFolderAttributes`.`value` like '%".$valueset[0].implode("%' OR `tblFolderAttributes`.`value` like '%".$valueset[0], $attribute)."%') AND `tblFolderAttributes`.`folder`=`tblFolders`.`id`)";
|
||||
} else {
|
||||
} elseif(is_string($attribute)) {
|
||||
$searchAttributes[] = "EXISTS (SELECT NULL FROM `tblFolderAttributes` WHERE `tblFolderAttributes`.`attrdef`=".$attrdefid." AND `tblFolderAttributes`.`value`='".$attribute."' AND `tblFolderAttributes`.`folder`=`tblFolders`.`id`)";
|
||||
}
|
||||
} else {
|
||||
|
@ -1554,7 +1554,7 @@ class SeedDMS_Core_DMS {
|
|||
$kkll[] = "`tblFolderAttributes`.`value`<='".$attribute['to']."'";
|
||||
if($kkll)
|
||||
$searchAttributes[] = "EXISTS (SELECT NULL FROM `tblFolderAttributes` WHERE `tblFolderAttributes`.`attrdef`=".$attrdefid." AND ".implode(' AND ', $kkll)." AND `tblFolderAttributes`.`folder`=`tblFolders`.`id`)";
|
||||
} else {
|
||||
} elseif(is_string($attribute)) {
|
||||
$searchAttributes[] = "EXISTS (SELECT NULL FROM `tblFolderAttributes` WHERE `tblFolderAttributes`.`attrdef`=".$attrdefid." AND `tblFolderAttributes`.`value` like '%".$attribute."%' AND `tblFolderAttributes`.`folder`=`tblFolders`.`id`)";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user