the relevant part of that line of code is:
((isset($_POST["BlogTitle"]))?preg_replace('/[^0-9a-z(),]/i','-',str_replace(array("%","!","?","@","\-","/",".","\"","_","\'","*","#"),"",$_POST["BlogTitle"])):"")
i bet the probelm is being caused by the magic quotes setting being turned on which adds a forward slash in fron t of the single quote (or actually apostrophe) in "Don't" turning it to "Don\'t"
Try adding stripslashes():
((isset($_POST["BlogTitle"]))?preg_replace('/[^0-9a-z(),]/i','-',str_replace(array("%","!","?","@","\-","/",".","\"","_","\'","*","#"),"",stripslashes($_POST["BlogTitle"]))):"")