* Change language setting variable of content types.
167
*
167
*
168
168
* Use language_content_type_<content_type> instead of language_<content_type>
169
169
* so content types such as 'default', 'count' or 'negotiation' will not
170
170
* interfere with language variables.
202
202
}
203
203
204
204
/**
205
* Neutralize unsafe language names in the database.
206
*/
207
function locale_update_6006() {
208
$ret = array();
209
$matches = db_result(db_query("SELECT 1 FROM {languages} WHERE native LIKE '%<%' OR native LIKE '%>%' OR name LIKE '%<%' OR name LIKE '%>%'"));
210
if ($matches) {
211
$ret[] = update_sql("UPDATE {languages} SET name = REPLACE(name, '<', ''), native = REPLACE(native, '<', '')");
212
$ret[] = update_sql("UPDATE {languages} SET name = REPLACE(name, '>', ''), native = REPLACE(native, '>', '')");
213
drupal_set_message('The language name in English and the native language name values of all the existing custom languages of your site have been sanitized for security purposes. Visit the <a href="'. url('admin/settings/language') .'">Languages</a> page to check these and fix them if necessary.', 'warning');
214
}
215
// Check if some langcode values contain potentially dangerous characters and
216
// warn the user if so. These are not fixed since they are referenced in other
217
// tables (e.g. {node}).
218
if (db_result(db_query("SELECT 1 FROM {languages} WHERE language LIKE '%<%' OR language LIKE '%>%' OR language LIKE '%\"%' OR language LIKE '%\\\\\%'"))) {
219
drupal_set_message('Some of your custom language code values contain invalid characters. You should examine the <a href="'. url('admin/settings/language') .'">Languages</a> page. These must be fixed manually.', 'error');