Fixed a user input sanitization issue in data.php.
Made minor security fixes and removed a deprecated function from data.php.