Thanks for bringing this one to our attention. I've reported it to our development team to investigate further. We'll update this post once they've review this.
I can now confirm that we've backported MDL-62239 and it'll be included in the next releases of Totara (10.12, 11.6 & Evergreen). These releases are due out week commencing 20th August.