Bug in cookie WP HTTP cookie parsing
|Reported by:||josephscott||Owned by:||dd32|
There's a small logic bug in the WP HTTP cookie code that will result in a PHP error. The code does an empty check, which is fine, but doesn't take into account the condition where the variable holds a string of spaces. To fix this I've included a small patch to rtrim() the value first, allowing for the empty check to work for this cases.
I ran into this while tracking down an error for some outbound PuSHPress pings on WordPress.com. It was triggering a PHP fatal error because it resulted in an empty object property trying to be referenced.