laravel/laravel — pull request #1787 by goldlife (2013-03-14 09:35:49+00:00)
Title: Check type in get_dirty()

Hello,
If you have an attribute something like this:
03332 (german zip) and the original value in the database is per example 3332,
you have trouble with this compare (in models/base/ get_dirty() :

if ( ! array_key_exists($key, $this->original) or $value != $this->original[$key])

Because this if doesn't compare the type of the $value and $this->original[$key]
for PHP is 03332 = 3332 so nothing will get in the dirty array which is definitely wrong.
So my proposal for solution is to compare also the type:

if ( ! array_key_exists($key, $this->original) or $value !== $this->original[$key])

Greetings,
Leif