Fix jQuery #13251: use slice instead of substring
(cherry picked from commit 37eb6125c0fb0bec4e0d043bc78110b4f49f3aa6)

*** Added an extra file to check for more complex ammends.
Merge remote-tracking branch 'origin/master'