This is not fixed upstream for fop yet, but has been fixed for a couple of other tools, like ant.
The patch is for ant and does not apply to fop directly, unless there is a way to specify the file to patch that I don't know.
I've reported the bug upstream: https://issues.apache.org/jira/browse/FOP-2356 - hopefully it will get fixed soon!