The clearest way to do this would probably be to simply do the disabling in a separate loop over the disabled extensions string, similarly to how we detect the extensions.