Lindsay cut it real close yesterday by arriving to court on time.

First things first. She was glitter bombed! Ok, now onto more important matters.

Lindsay was in court for reckless driving and lying to cops about the accident she got into last year with her Porsche.

The judge has been fairly good with her in the past. But, yesterday the judge came down in a pretty hard core way. Lindsay did avoid jail time. However, she will be going to rehab for 90 days.

Now, this is not the first time that Lindsay has been sentenced to rehab. This time though, she's being confined to a rehab that she is not allowed to leave.

She also got 30 days community service and 2 years of probation. She'll also have to submit to random drug testing.

Let's just hope it sticks this time.