security update core+modules

This commit is contained in:
Bachir Soussi Chiadmi
2015-04-26 18:38:56 +02:00
parent 2f45ea820a
commit 7c96373038
1022 changed files with 30319 additions and 11259 deletions

View File

@@ -388,13 +388,13 @@ function locale_languages_edit_form_validate($form, &$form_state) {
form_set_error('prefix', t('Domain and path prefix values should not be set at the same time.'));
}
if (!empty($form_state['values']['domain']) && $duplicate = db_query("SELECT language FROM {languages} WHERE domain = :domain AND language <> :language", array(':domain' => $form_state['values']['domain'], ':language' => $form_state['values']['langcode']))->fetchField()) {
form_set_error('domain', t('The domain (%domain) is already tied to a language (%language).', array('%domain' => $form_state['values']['domain'], '%language' => $duplicate->language)));
form_set_error('domain', t('The domain (%domain) is already tied to a language (%language).', array('%domain' => $form_state['values']['domain'], '%language' => $duplicate)));
}
if (empty($form_state['values']['prefix']) && language_default('language') != $form_state['values']['langcode'] && empty($form_state['values']['domain'])) {
form_set_error('prefix', t('Only the default language can have both the domain and prefix empty.'));
}
if (!empty($form_state['values']['prefix']) && $duplicate = db_query("SELECT language FROM {languages} WHERE prefix = :prefix AND language <> :language", array(':prefix' => $form_state['values']['prefix'], ':language' => $form_state['values']['langcode']))->fetchField()) {
form_set_error('prefix', t('The prefix (%prefix) is already tied to a language (%language).', array('%prefix' => $form_state['values']['prefix'], '%language' => $duplicate->language)));
form_set_error('prefix', t('The prefix (%prefix) is already tied to a language (%language).', array('%prefix' => $form_state['values']['prefix'], '%language' => $duplicate)));
}
}
@@ -1139,11 +1139,11 @@ function locale_translate_edit_form($form, &$form_state, $lid) {
'#value' => $source->location
);
// Include default form controls with empty values for all languages.
// This ensures that the languages are always in the same order in forms.
// Include both translated and not yet translated target languages in the
// list. The source language is English for built-in strings and the default
// language for other strings.
$languages = language_list();
$default = language_default();
// We don't need the default language value, that value is in $source.
$omit = $source->textgroup == 'default' ? 'en' : $default->language;
unset($languages[($omit)]);
$form['translations'] = array('#tree' => TRUE);
@@ -1242,9 +1242,7 @@ function locale_translate_delete_page($lid) {
if ($source = db_query('SELECT lid, source FROM {locales_source} WHERE lid = :lid', array(':lid' => $lid))->fetchObject()) {
return drupal_get_form('locale_translate_delete_form', $source);
}
else {
return drupal_not_found();
}
return MENU_NOT_FOUND;
}
/**

View File

@@ -5,3 +5,9 @@ version = VERSION
core = 7.x
files[] = locale.test
configure = admin/config/regional/language
; Information added by Drupal.org packaging script on 2015-04-02
version = "7.36"
project = "drupal"
datestamp = "1427943826"

View File

@@ -386,20 +386,53 @@ function locale_form_node_form_alter(&$form, &$form_state) {
/**
* Form submit handler for node_form().
*
* Checks if Locale is registered as a translation handler and handle possible
* node language changes.
*
* This submit handler needs to run before entity_form_submit_build_entity()
* is invoked by node_form_submit_build_node(), because it alters the values of
* attached fields. Therefore, it cannot be a hook_node_submit() implementation.
*/
function locale_field_node_form_submit($form, &$form_state) {
if (field_has_translation_handler('node', 'locale')) {
$node = (object) $form_state['values'];
$current_language = entity_language('node', $node);
list(, , $bundle) = entity_extract_ids('node', $node);
locale_field_entity_form_submit('node', $form, $form_state);
}
foreach (field_info_instances('node', $bundle) as $instance) {
/**
* Implements hook_form_FORM_ID_alter().
*/
function locale_form_comment_form_alter(&$form, &$form_state, $form_id) {
// If a content type has multilingual support we set the content language as
// comment language.
if ($form['language']['#value'] == LANGUAGE_NONE && locale_multilingual_node_type($form['#node']->type)) {
global $language_content;
$form['language']['#value'] = $language_content->language;
$submit_callback = 'locale_field_comment_form_submit';
array_unshift($form['actions']['preview']['#submit'], $submit_callback);
array_unshift($form['#submit'], $submit_callback);
}
}
/**
* Form submit handler for comment_form().
*
* This submit handler needs to run before entity_form_submit_build_entity()
* is invoked by comment_form_submit_build_comment(), because it alters the
* values of attached fields.
*/
function locale_field_comment_form_submit($form, &$form_state) {
locale_field_entity_form_submit('comment', $form, $form_state);
}
/**
* Handles field language on submit for the given entity type.
*
* Checks if Locale is registered as a translation handler and handle possible
* language changes.
*/
function locale_field_entity_form_submit($entity_type, $form, &$form_state ) {
if (field_has_translation_handler($entity_type, 'locale')) {
$entity = (object) $form_state['values'];
$current_language = entity_language($entity_type, $entity);
list(, , $bundle) = entity_extract_ids($entity_type, $entity);
foreach (field_info_instances($entity_type, $bundle) as $instance) {
$field_name = $instance['field_name'];
$field = field_info_field($field_name);
$previous_language = $form[$field_name]['#language'];
@@ -407,7 +440,7 @@ function locale_field_node_form_submit($form, &$form_state) {
// Handle a possible language change: new language values are inserted,
// previous ones are deleted.
if ($field['translatable'] && $previous_language != $current_language) {
$form_state['values'][$field_name][$current_language] = $node->{$field_name}[$previous_language];
$form_state['values'][$field_name][$current_language] = $entity->{$field_name}[$previous_language];
$form_state['values'][$field_name][$previous_language] = array();
}
}
@@ -491,6 +524,9 @@ function locale_field_language_fallback(&$display_language, $entity, $langcode)
*/
function locale_entity_info_alter(&$entity_info) {
$entity_info['node']['translation']['locale'] = TRUE;
if (isset($entity_info['comment'])) {
$entity_info['comment']['translation']['locale'] = TRUE;
}
}
/**
@@ -936,7 +972,7 @@ function locale_css_alter(&$css) {
// Replicate the same item, but with the RTL path and a little larger
// weight so that it appears directly after the original CSS file.
$item['data'] = $rtl_path;
$item['weight'] += 0.01;
$item['weight'] += 0.0001;
$css[$rtl_path] = $item;
}
}
@@ -1060,15 +1096,3 @@ function locale_url_outbound_alter(&$path, &$options, $original_path) {
}
}
}
/**
* Implements hook_form_FORM_ID_alter().
*/
function locale_form_comment_form_alter(&$form, &$form_state, $form_id) {
// If a content type has multilingual support we set the content language as
// comment language.
if ($form['language']['#value'] == LANGUAGE_NONE && locale_multilingual_node_type($form['#node']->type)) {
global $language_content;
$form['language']['#value'] = $language_content->language;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -4,3 +4,9 @@ core = 7.x
package = Testing
version = VERSION
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-04-02
version = "7.36"
project = "drupal"
datestamp = "1427943826"