Applied patch of http://trac.symfony-project.org/ticket/10075 to 1.3 branch