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

@@ -12,7 +12,6 @@
*
* To return:
* the complete search path
*
*/
function _custom_search_search_api_search($variables) {
@@ -21,11 +20,13 @@ function _custom_search_search_api_search($variables) {
$keys = array();
if (count($variables['types']) && !in_array('all', $variables['types'])) {
foreach ($variables['types'] as $key => $value) $keys["filter[type][$key]"] = "\"$value\"";
foreach ($variables['types'] as $key => $value) {
$keys["filter[type][$key]"] = "\"$value\"";
}
}
if (module_exists('taxonomy') && count($variables['terms'])) {
// Get index fields info, and keeps only the taxonomy ones
// Get index fields info, and keeps only the taxonomy ones.
$index = search_api_index_load($variables['page']->index_id);
$fields = array();
foreach ($index->options['fields'] as $field => $data) {
@@ -34,14 +35,15 @@ function _custom_search_search_api_search($variables) {
$fields[$field_info['settings']['allowed_values'][0]['vocabulary']] = $field;
}
}
// Adds terms
// Adds terms.
foreach ($variables['terms'] as $key => $value) {
$term = taxonomy_term_load($value);
if (array_key_exists($term->vocabulary_machine_name, $fields))
if (array_key_exists($term->vocabulary_machine_name, $fields)) {
$keys['filter[' . $fields[$term->vocabulary_machine_name] . '][' . $key . ']'] = "\"$value\"";
}
}
}
return array('path' => $type, 'query' => $keys);
}
}