fix sanitize_transient function

input for substr was an undefined $string. Changed this to $name, which is the string being shortened