Improve input validation in bp-default's ajax.php. Props Maty. (1.6 branch)