I read somewhere that the Canon ETTL-II system cannot read subject distance from Canon's EF 50mm f/1.8 II lens.
Is this the same for Canon's more recent 50mm f/1.8 STM lens?
The EF 50mm f/1.8 STM does report distance information. As do all Ring Type USM, STM, and Nano USM lenses.
In the past, only lenses with Ring Type USM Auto Focus had distance info. Older lenses with Arc Form Drive AF, Micro Motor AF, Micro USM AF did not.
With “Magic Lantern” firmware installed on your camera, there is an option to display Focus Distance information, but only if your lens has distance reporting.
This menu also includes Focus Distance and other DOF information like DOF Near, DOF Far, and Hyperfocal Distance. The values change with any changes to aperture, focus distance or focal length.
Here is a quick video showing how distance info can be displayed with the Magic Lantern firmware on your camera. Magic Lantern DOF Information
No it's not true for the STM version. I have taken pictures with it, and the EXIF data clearly shows "focus distance lower" and "focus distance upper" information. So the camera is getting focus distance information, and it would be very strange if the camera didn't use that for the E-TTL II flash system.
This is the range where the focus can be, not exact value but rather a range. Good enough for flash, though. Not good enough for using your camera in place of a tape measure.
Here's one from a picture taken with the EF 50mm F/1.8 STM lens:
$ exiftool IMG_0163.JPG |grep -i focus.distance
Focus Distance Upper : 1.41 m
Focus Distance Lower : 1.1 m