-
Incident report
-
Resolution: Duplicate
-
Major
-
None
-
1.8.18
-
None
profiles table string values are stored in db rounded by an unwanted set of single quotes.
for example, when you open any host's items list (let's say TESTHOST), modify any of its existing item by clicking on item name and save, by the time you got back to host's item list, filter "Host:" changes from TESTHOST to 'TESTHOST', and you don't see this host items anymore.
the same 'quoting' transformation happens to any string filter values, Host group, Application, Description etc.
the problem is in private static function updateDB($idx, $value, $type, $idx2){ of include/profiles.inc.php:
---------------
$value_type = self::getFieldByType($type);
$value = ($value_type == 'value_str') ? zbx_dbstr($value) : $value;
$sql = 'UPDATE profiles SET '.
$value_type.'='.zbx_dbstr($value).','.
' type='.zbx_dbstr($type).
' WHERE userid='.$USER_DETAILS['userid'].
' AND idx='.zbx_dbstr($idx).
$sql_cond;
$result = DBexecute($sql);
---------------
as you can see, if $value_type is 'value_str', $value gets transformed by zbx_dbstr() twice, which leads to storing \'$value\' instead of $value in db.
there might be another places where ZBX-7091 caused unwanted sideeffects, but multitude of zbx_dbstr calls makes it very hard to find them.
- duplicates
-
ZBX-7156 Incorrect URL after login
- Closed