Projet

Général

Profil

Révision 582db59d

Ajouté par Assos Assos il y a plus de 8 ans

Update Drupal core to version 7.40

Voir les différences:

drupal7/includes/bootstrap.inc
8 8
/**
9 9
 * The current system version.
10 10
 */
11
define('VERSION', '7.39');
11
define('VERSION', '7.40');
12 12

  
13 13
/**
14 14
 * Core API compatibility.
......
1055 1055
 * Determines the cacheability of the current page.
1056 1056
 *
1057 1057
 * @param $allow_caching
1058
 *   Set to FALSE if you want to prevent this page to get cached.
1058
 *   Set to FALSE if you want to prevent this page from being cached.
1059 1059
 *
1060 1060
 * @return
1061 1061
 *   TRUE if the current page can be cached, FALSE otherwise.
......
1262 1262
  $default_headers = array(
1263 1263
    'Expires' => 'Sun, 19 Nov 1978 05:00:00 GMT',
1264 1264
    'Cache-Control' => 'no-cache, must-revalidate, post-check=0, pre-check=0',
1265
    // Prevent browsers from sniffing a response and picking a MIME type
1266
    // different from the declared content-type, since that can lead to
1267
    // XSS and other vulnerabilities.
1268
    'X-Content-Type-Options' => 'nosniff',
1265 1269
  );
1266 1270
  drupal_send_headers($default_headers);
1267 1271
}
......
1776 1780
 * @see theme_status_messages()
1777 1781
 */
1778 1782
function drupal_set_message($message = NULL, $type = 'status', $repeat = TRUE) {
1779
  if ($message) {
1783
  if ($message || $message === '0' || $message === 0) {
1780 1784
    if (!isset($_SESSION['messages'][$type])) {
1781 1785
      $_SESSION['messages'][$type] = array();
1782 1786
    }
......
2464 2468
  // the install or upgrade process.
2465 2469
  spl_autoload_register('drupal_autoload_class');
2466 2470
  spl_autoload_register('drupal_autoload_interface');
2471
  if (version_compare(PHP_VERSION, '5.4') >= 0) {
2472
    spl_autoload_register('drupal_autoload_trait');
2473
  }
2467 2474
}
2468 2475

  
2469 2476
/**
......
2952 2959
 * Gets the schema definition of a table, or the whole database schema.
2953 2960
 *
2954 2961
 * The returned schema will include any modifications made by any
2955
 * module that implements hook_schema_alter().
2962
 * module that implements hook_schema_alter(). To get the schema without
2963
 * modifications, use drupal_get_schema_unprocessed().
2964
 *
2956 2965
 *
2957 2966
 * @param $table
2958 2967
 *   The name of the table. If not given, the schema of all tables is returned.
......
3107 3116
  return _registry_check_code('class', $class);
3108 3117
}
3109 3118

  
3119
/**
3120
 * Confirms that a trait is available.
3121
 *
3122
 * This function is rarely called directly. Instead, it is registered as an
3123
 * spl_autoload() handler, and PHP calls it for us when necessary.
3124
 *
3125
 * @param string $trait
3126
 *   The name of the trait to check or load.
3127
 *
3128
 * @return bool
3129
 *   TRUE if the trait is currently available, FALSE otherwise.
3130
 */
3131
function drupal_autoload_trait($trait) {
3132
  return _registry_check_code('trait', $trait);
3133
}
3134

  
3110 3135
/**
3111 3136
 * Checks for a resource in the registry.
3112 3137
 *
......
3125 3150
function _registry_check_code($type, $name = NULL) {
3126 3151
  static $lookup_cache, $cache_update_needed;
3127 3152

  
3128
  if ($type == 'class' && class_exists($name) || $type == 'interface' && interface_exists($name)) {
3153
  if ($type == 'class' && class_exists($name) || $type == 'interface' && interface_exists($name) || $type == 'trait' && trait_exists($name)) {
3129 3154
    return TRUE;
3130 3155
  }
3131 3156

  

Formats disponibles : Unified diff