I’m not familiar with Joomla enough to advise on it, but yes, since Joomla is written in PHP such a hack could compromise a Joomla installation as well. You should be able to use the same method to fix Joomla PHP files as I describe here for WordPress.