Refs #17999 - Use endsWith instead of cryptic JS substr