Removes any language negotiation methods that are no longer defined.
function language_negotiation_purge() {
// Ensure that we are getting the defined language negotiation information. An
// invocation of module_enable() or module_disable() could outdate the cached
// information.
drupal_static_reset('language_negotiation_info');
drupal_static_reset('language_types_info');
$negotiation_info = language_negotiation_info();
foreach (language_types_info() as $type => $type_info) {
$weight = 0;
$method_weights = array();
foreach (variable_get("language_negotiation_{$type}", array()) as $method_id => $method) {
if (isset($negotiation_info[$method_id])) {
$method_weights[$method_id] = $weight++;
}
}
language_negotiation_set($type, $method_weights);
}
}