His change didn't include %. You could just add that if you wish.

$twi_cleanPname = preg_replace('/%&#0*39;|\'/', '', $twi_cleanPname);