sonnb
Well-known member
PHP:
protected function _setInternal($table, $field, $newValue, $forceSet = false)
{
$existingValue = $this->get($field, $table);
if ($forceSet
|| $existingValue === null
|| !is_scalar($newValue)
|| !is_scalar($existingValue)
|| strval($newValue) != strval($existingValue)
)
{
if ($newValue === $this->getExisting($field, $table))
{
unset($this->_newData[$table][$field]);
}
else
{
$this->_newData[$table][$field] = $newValue;
}
}
}
XenForo use this function to check if new value is equal to existing value and save the new value. But this might be false in some case because of
PHP:
strval($newValue) != strval($existingValue)
PHP:
strval('0122456') != strval('122456')
PHP:
strval($newValue) !== strval($existingValue)