Fix verifCond must return false if string is '0'

Hide a not used property.
This commit is contained in:
Laurent Destailleur
2021-11-18 13:10:52 +01:00
parent e652b93878
commit 2d4f971508
2 changed files with 6 additions and 7 deletions

View File

@@ -8132,10 +8132,10 @@ function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid =
/**
* Verify if condition in string is ok or not
*
* @param string $strRights String with condition to check
* @return boolean True or False. Return True if strRights is ''
* @param string $strToEvaluate String with condition to check
* @return boolean True or False. Note: It returns True if $strToEvaluate is ''
*/
function verifCond($strRights)
function verifCond($strToEvaluate)
{
global $user, $conf, $langs;
global $leftmenu;
@@ -8143,8 +8143,8 @@ function verifCond($strRights)
//print $strRights."<br>\n";
$rights = true;
if ($strRights != '') {
$str = 'if(!('.$strRights.')) { $rights = false; }';
if ($strToEvaluate !== '') {
$str = 'if(!('.$strToEvaluate.')) { $rights = false; }';
dol_eval($str); // The dol_eval must contains all the global $xxx used into a condition
}
return $rights;