Add the missing part of pr #288, which is the new function itself. Contributed by Michael Osipov. Bugzill Id: 60883