think-orm icon indicating copy to clipboard operation
think-orm copied to clipboard

数据变更比较判断不严谨造成数据无法正常更新

Open chuoke opened this issue 2 years ago • 1 comments

https://github.com/top-think/think-orm/blob/97b061b47616301ff29fbd4c35ed9184e1162e4e/src/model/concern/Attribute.php#L318

例如,字符串首位有 0 或 空格,与任何值都是相等的,造成数据无法正常更新, 是否可以改成 绝对等于或 strcmp($a, $b) !== 0 这种类似的强类型比较。

chuoke avatar Jul 05 '22 08:07 chuoke

非强类型不好吗?如果这个需求采用,那已有项目不就出现问题(不兼容了)吗?

xhwsd avatar Jul 09 '22 06:07 xhwsd