Projet

Général

Profil

Révision b4adf10d

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

Udpate to 7.33

Voir les différences:

drupal7/CHANGELOG.txt
1 1

  
2
Drupal 7.33, 2014-11-07
3
-----------------------
4
- Began storing the file modification time of each module and theme in the
5
  {system} database table so that contributed modules can use it to identify
6
  recently changed modules and themes (minor data structure change to the
7
  return value of system_get_info() and other related functions).
8
- Added a "Did you mean?" feature to the run-tests.sh script for running
9
  automated tests from the command line, to help developers who are attempting
10
  to run a particular test class or group.
11
- Changed the date format used in various HTTP headers output by Drupal core
12
  from RFC 1123 format to RFC 7231 format.
13
- Added a "block_cache_bypass_node_grants" variable to allow sites which have
14
  node access modules enabled to use the block cache if desired (API addition).
15
- Made image derivative generation HTTP requests return a 404 error (rather
16
  than a 500 error) when the source image does not exist.
17
- Fixed a bug which caused user pictures to be removed from the user object
18
  after saving, and resulted in data loss if the user account was subsequently
19
  re-saved.
20
- Fixed a bug in which field_has_data() did not return TRUE for fields that
21
  only had data in older entity revisions, leading to loss of the field's data
22
  when the field configuration was edited.
23
- Fixed a bug which caused the Ajax progress throbber to appear misaligned in
24
  many situatons (minor styling change).
25
- Prevented the Bartik theme from lower-casing the "Permalink" link on
26
  comments, for improved multilingual support (minor UI change).
27
- Added a "preferred_menu_links" tag to the database query that is used by
28
  menu_link_get_preferred() to find the preferred menu link for a given path,
29
  to make it easier to alter.
30
- Increased the maximum allowed length of block titles to 255 characters
31
  (database schema change to the {block} table).
32
- Removed the Field module's field_modules_uninstalled() function, since it did
33
  not do anything when it was invoked.
34
- Added a "theme_hook_original" variable to templates and theme functions and
35
  an optional sitewide theme debug mode, to provide contextual information in
36
  the page's HTML to theme developers. The theme debug mode is based on the one
37
  used with Twig in Drupal 8 and can be accessed by setting the "theme_debug"
38
  variable to TRUE (API addition).
39
- Added an entity_view_mode_prepare() API function to allow entity-defining
40
  modules to properly invoke hook_entity_view_mode_alter(), and used it
41
  throughout Drupal core to fix bugs with the invocation of that hook (API
42
  change: https://www.drupal.org/node/2369141).
43
- Security improvement: Made the database API's orderBy() method sanitize the
44
  sort direction ("ASC" or "DESC") for queries built with db_select(), so that
45
  calling code does not have to.
46
- Changed the RDF module to consistently output RDF metadata for nodes and
47
  comments near where the node is rendered in the HTML (minor markup and data
48
  structure change).
49
- Added an HTML class to RDFa metatags throughout Drupal to prevent them from
50
  accidentally affecting the site appearance (minor markup change).
51
- Fixed a bug in the Unicode requirements check which prevented installing
52
  Drupal on PHP 5.6.
53
- Fixed a bug which caused drupal_get_bootstrap_phase() to abort the bootstrap
54
  when called early in the page request.
55
- Renamed the "Search result" view mode to "Search result highlighting input"
56
  to better reflect how it is used (UI change).
57
- Improved database queries generated by EntityFieldQuery in the case where
58
  delta or language condition groups are used, to reduce the number of INNER
59
  JOINs (this is a minor data structure change affecting code which implements
60
  hook_query_alter() on these queries).
61
- Removed special-case behavior for file uploads which allowed user #1 to
62
  bypass maximum file size and user quota limits.
63
- Numerous small bug fixes.
64
- Numerous API documentation improvements.
65
- Additional automated test coverage.
66

  
2 67
Drupal 7.32, 2014-10-15
3 68
----------------------
4 69
- Fixed security issues (SQL injection). See SA-CORE-2014-005.
drupal7/includes/ajax.inc
276 276

  
277 277
  $extra_commands = array();
278 278
  if (!empty($styles)) {
279
    $extra_commands[] = ajax_command_prepend('head', $styles);
279
    $extra_commands[] = ajax_command_add_css($styles);
280 280
  }
281 281
  if (!empty($scripts_header)) {
282 282
    $extra_commands[] = ajax_command_prepend('head', $scripts_header);
......
292 292
  $scripts = drupal_add_js();
293 293
  if (!empty($scripts['settings'])) {
294 294
    $settings = $scripts['settings'];
295
    array_unshift($commands, ajax_command_settings(call_user_func_array('array_merge_recursive', $settings['data']), TRUE));
295
    array_unshift($commands, ajax_command_settings(drupal_array_merge_deep_array($settings['data']), TRUE));
296 296
  }
297 297

  
298 298
  // Allow modules to alter any Ajax response.
......
1257 1257
    'new' => $form['#build_id'],
1258 1258
  );
1259 1259
}
1260

  
1261
/**
1262
 * Creates a Drupal Ajax 'add_css' command.
1263
 *
1264
 * This method will add css via ajax in a cross-browser compatible way.
1265
 *
1266
 * This command is implemented by Drupal.ajax.prototype.commands.add_css()
1267
 * defined in misc/ajax.js.
1268
 *
1269
 * @param $styles
1270
 *   A string that contains the styles to be added.
1271
 *
1272
 * @return
1273
 *   An array suitable for use with the ajax_render() function.
1274
 *
1275
 * @see misc/ajax.js
1276
 */
1277
function ajax_command_add_css($styles) {
1278
  return array(
1279
    'command' => 'add_css',
1280
    'data' => $styles,
1281
  );
1282
}
drupal7/includes/bootstrap.inc
8 8
/**
9 9
 * The current system version.
10 10
 */
11
define('VERSION', '7.32');
11
define('VERSION', '7.33');
12 12

  
13 13
/**
14 14
 * Core API compatibility.
......
248 248
 */
249 249
define('DRUPAL_PHP_FUNCTION_PATTERN', '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*');
250 250

  
251
/**
252
 * A RFC7231 Compliant date.
253
 *
254
 * http://tools.ietf.org/html/rfc7231#section-7.1.1.1
255
 *
256
 * Example: Sun, 06 Nov 1994 08:49:37 GMT
257
 */
258
define('DATE_RFC7231', 'D, d M Y H:i:s \G\M\T');
259

  
251 260
/**
252 261
 * Provides a caching wrapper to be used in place of large array structures.
253 262
 *
......
852 861
    try {
853 862
      if (function_exists('db_query')) {
854 863
        $file = db_query("SELECT filename FROM {system} WHERE name = :name AND type = :type", array(':name' => $name, ':type' => $type))->fetchField();
855
        if (file_exists(DRUPAL_ROOT . '/' . $file)) {
864
        if ($file !== FALSE && file_exists(DRUPAL_ROOT . '/' . $file)) {
856 865
          $files[$type][$name] = $file;
857 866
        }
858 867
      }
......
1266 1275

  
1267 1276
  $default_headers = array(
1268 1277
    'Expires' => 'Sun, 19 Nov 1978 05:00:00 GMT',
1269
    'Last-Modified' => gmdate(DATE_RFC1123, REQUEST_TIME),
1278
    'Last-Modified' => gmdate(DATE_RFC7231, REQUEST_TIME),
1270 1279
    'Cache-Control' => 'no-cache, must-revalidate, post-check=0, pre-check=0',
1271 1280
    'ETag' => '"' . REQUEST_TIME . '"',
1272 1281
  );
......
1336 1345
    drupal_add_http_header($name, $value);
1337 1346
  }
1338 1347

  
1339
  $default_headers['Last-Modified'] = gmdate(DATE_RFC1123, $cache->created);
1348
  $default_headers['Last-Modified'] = gmdate(DATE_RFC7231, $cache->created);
1340 1349

  
1341 1350
  // HTTP/1.0 proxies does not support the Vary header, so prevent any caching
1342 1351
  // by sending an Expires date in the past. HTTP/1.1 clients ignores the
......
1559 1568
 * Also validates strings as UTF-8 to prevent cross site scripting attacks on
1560 1569
 * Internet Explorer 6.
1561 1570
 *
1562
 * @param $text
1571
 * @param string $text
1563 1572
 *   The text to be checked or processed.
1564 1573
 *
1565
 * @return
1566
 *   An HTML safe version of $text, or an empty string if $text is not
1567
 *   valid UTF-8.
1574
 * @return string
1575
 *   An HTML safe version of $text. If $text is not valid UTF-8, an empty string
1576
 *   is returned and, on PHP < 5.4, a warning may be issued depending on server
1577
 *   configuration (see @link https://bugs.php.net/bug.php?id=47494 @endlink).
1568 1578
 *
1569 1579
 * @see drupal_validate_utf8()
1570 1580
 * @ingroup sanitization
......
2176 2186
 *   drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
2177 2187
 * @endcode
2178 2188
 *
2179
 * @param $phase
2189
 * @param int $phase
2180 2190
 *   A constant telling which phase to bootstrap to. When you bootstrap to a
2181 2191
 *   particular phase, all earlier phases are run automatically. Possible
2182 2192
 *   values:
......
2189 2199
 *   - DRUPAL_BOOTSTRAP_LANGUAGE: Finds out the language of the page.
2190 2200
 *   - DRUPAL_BOOTSTRAP_FULL: Fully loads Drupal. Validates and fixes input
2191 2201
 *     data.
2192
 * @param $new_phase
2202
 * @param boolean $new_phase
2193 2203
 *   A boolean, set to FALSE if calling drupal_bootstrap from inside a
2194 2204
 *   function called from drupal_bootstrap (recursion).
2195 2205
 *
2196
 * @return
2206
 * @return int
2197 2207
 *   The most recently completed phase.
2198 2208
 */
2199 2209
function drupal_bootstrap($phase = NULL, $new_phase = TRUE) {
......
2215 2225
  // bootstrap state.
2216 2226
  static $stored_phase = -1;
2217 2227

  
2218
  // When not recursing, store the phase name so it's not forgotten while
2219
  // recursing.
2220
  if ($new_phase) {
2221
    $final_phase = $phase;
2222
  }
2223 2228
  if (isset($phase)) {
2229
    // When not recursing, store the phase name so it's not forgotten while
2230
    // recursing but take care of not going backwards.
2231
    if ($new_phase && $phase >= $stored_phase) {
2232
      $final_phase = $phase;
2233
    }
2234

  
2224 2235
    // Call a phase if it has not been called before and is below the requested
2225 2236
    // phase.
2226 2237
    while ($phases && $phase > $stored_phase && $final_phase > $stored_phase) {
......
2508 2519
 * @see drupal_bootstrap()
2509 2520
 */
2510 2521
function drupal_get_bootstrap_phase() {
2511
  return drupal_bootstrap();
2522
  return drupal_bootstrap(NULL, FALSE);
2512 2523
}
2513 2524

  
2514 2525
/**
......
3328 3339
 * @param $default_value
3329 3340
 *   Optional default value.
3330 3341
 * @param $reset
3331
 *   TRUE to reset a specific named variable, or all variables if $name is NULL.
3332
 *   Resetting every variable should only be used, for example, for running
3333
 *   unit tests with a clean environment. Should be used only though via
3334
 *   function drupal_static_reset() and the return value should not be used in
3335
 *   this case.
3342
 *   TRUE to reset one or all variables(s). This parameter is only used
3343
 *   internally and should not be passed in; use drupal_static_reset() instead.
3344
 *   (This function's return value should not be used when TRUE is passed in.)
3336 3345
 *
3337 3346
 * @return
3338 3347
 *   Returns a variable by reference.
......
3377 3386
 *
3378 3387
 * @param $name
3379 3388
 *   Name of the static variable to reset. Omit to reset all variables.
3389
 *   Resetting all variables should only be used, for example, for running unit
3390
 *   tests with a clean environment.
3380 3391
 */
3381 3392
function drupal_static_reset($name = NULL) {
3382 3393
  drupal_static($name, NULL, TRUE);
drupal7/includes/cache.inc
98 98
 * @param $data
99 99
 *   The data to store in the cache. Complex data types will be automatically
100 100
 *   serialized before insertion. Strings will be stored as plain text and are
101
 *   not serialized.
101
 *   not serialized. Some storage engines only allow objects up to a maximum of
102
 *   1MB in size to be stored by default. When caching large arrays or similar,
103
 *   take care to ensure $data does not exceed this size.
102 104
 * @param $bin
103
 *   The cache bin to store the data in. Valid core values are:
105
 *   (optional) The cache bin to store the data in. Valid core values are:
104 106
 *   - cache: (default) Generic cache storage bin (used for theme registry,
105 107
 *     locale date, list of simpletest tests, etc.).
106 108
 *   - cache_block: Stores the content of various blocks.
......
119 121
 *     the administrator panel.
120 122
 *   - cache_path: Stores the system paths that have an alias.
121 123
 * @param $expire
122
 *   One of the following values:
124
 *   (optional) One of the following values:
123 125
 *   - CACHE_PERMANENT: Indicates that the item should never be removed unless
124 126
 *     explicitly told to using cache_clear_all() with a cache ID.
125 127
 *   - CACHE_TEMPORARY: Indicates that the item should be removed at the next
......
254 256
   *   The cache ID of the data to store.
255 257
   * @param $data
256 258
   *   The data to store in the cache. Complex data types will be automatically
257
   *   serialized before insertion.
258
   *   Strings will be stored as plain text and not serialized.
259
   *   serialized before insertion. Strings will be stored as plain text and not
260
   *   serialized. Some storage engines only allow objects up to a maximum of
261
   *   1MB in size to be stored by default. When caching large arrays or
262
   *   similar, take care to ensure $data does not exceed this size.
259 263
   * @param $expire
260
   *   One of the following values:
264
   *   (optional) One of the following values:
261 265
   *   - CACHE_PERMANENT: Indicates that the item should never be removed unless
262 266
   *     explicitly told to using cache_clear_all() with a cache ID.
263 267
   *   - CACHE_TEMPORARY: Indicates that the item should be removed at the next
drupal7/includes/common.inc
985 985
  $response = preg_split("/\r\n|\n|\r/", $response);
986 986

  
987 987
  // Parse the response status line.
988
  list($protocol, $code, $status_message) = explode(' ', trim(array_shift($response)), 3);
989
  $result->protocol = $protocol;
990
  $result->status_message = $status_message;
988
  $response_status_array = _drupal_parse_response_status(trim(array_shift($response)));
989
  $result->protocol = $response_status_array['http_version'];
990
  $result->status_message = $response_status_array['reason_phrase'];
991
  $code = $response_status_array['response_code'];
991 992

  
992 993
  $result->headers = array();
993 994

  
......
1078 1079
      }
1079 1080
      break;
1080 1081
    default:
1081
      $result->error = $status_message;
1082
      $result->error = $result->status_message;
1082 1083
  }
1083 1084

  
1084 1085
  return $result;
1085 1086
}
1086 1087

  
1088
/**
1089
 * Splits an HTTP response status line into components.
1090
 *
1091
 * See the @link http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html status line definition @endlink
1092
 * in RFC 2616.
1093
 *
1094
 * @param string $respone
1095
 *   The response status line, for example 'HTTP/1.1 500 Internal Server Error'.
1096
 *
1097
 * @return array
1098
 *   Keyed array containing the component parts. If the response is malformed,
1099
 *   all possible parts will be extracted. 'reason_phrase' could be empty.
1100
 *   Possible keys:
1101
 *   - 'http_version'
1102
 *   - 'response_code'
1103
 *   - 'reason_phrase'
1104
 */
1105
function _drupal_parse_response_status($response) {
1106
  $response_array = explode(' ', trim($response), 3);
1107
  // Set up empty values.
1108
  $result = array(
1109
    'reason_phrase' => '',
1110
  );
1111
  $result['http_version'] = $response_array[0];
1112
  $result['response_code'] = $response_array[1];
1113
  if (isset($response_array[2])) {
1114
    $result['reason_phrase'] = $response_array[2];
1115
  }
1116
  return $result;
1117
}
1118

  
1087 1119
/**
1088 1120
 * Helper function for determining hosts excluded from needing a proxy.
1089 1121
 *
......
3442 3474
            $import_batch = array_slice($import, 0, 31);
3443 3475
            $import = array_slice($import, 31);
3444 3476
            $element = $style_element_defaults;
3445
            $element['#value'] = implode("\n", $import_batch);
3477
            // This simplifies the JavaScript regex, allowing each line
3478
            // (separated by \n) to be treated as a completely different string.
3479
            // This means that we can use ^ and $ on one line at a time, and not
3480
            // worry about style tags since they'll never match the regex.
3481
            $element['#value'] = "\n" . implode("\n", $import_batch) . "\n";
3446 3482
            $element['#attributes']['media'] = $group['media'];
3447 3483
            $element['#browsers'] = $group['browsers'];
3448 3484
            $elements[] = $element;
......
3768 3804
  // Alter all internal url() paths. Leave external paths alone. We don't need
3769 3805
  // to normalize absolute paths here (i.e. remove folder/... segments) because
3770 3806
  // that will be done later.
3771
  return preg_replace('/url\(\s*([\'"]?)(?![a-z]+:|\/+)/i', 'url(\1'. $directory, $file);
3807
  return preg_replace('/url\(\s*([\'"]?)(?![a-z]+:|\/+)([^\'")]+)([\'"]?)\s*\)/i', 'url(\1' . $directory . '\2\3)', $file);
3772 3808
}
3773 3809

  
3774 3810
/**
......
5255 5291
    foreach ($queues as $queue_name => $info) {
5256 5292
      DrupalQueue::get($queue_name)->createQueue();
5257 5293
    }
5258
    // Register shutdown callback.
5259
    drupal_register_shutdown_function('drupal_cron_cleanup');
5260 5294

  
5261 5295
    // Iterate through the modules calling their cron handlers (if any):
5262 5296
    foreach (module_implements('cron') as $module) {
......
5308 5342
}
5309 5343

  
5310 5344
/**
5311
 * Shutdown function: Performs cron cleanup.
5345
 * DEPRECATED: Shutdown function: Performs cron cleanup.
5312 5346
 *
5313
 * @see drupal_cron_run()
5314
 * @see drupal_register_shutdown_function()
5347
 * This function is deprecated because the 'cron_semaphore' variable it
5348
 * references no longer exists. It is therefore no longer used as a shutdown
5349
 * function by Drupal core.
5350
 *
5351
 * @deprecated
5315 5352
 */
5316 5353
function drupal_cron_cleanup() {
5317 5354
  // See if the semaphore is still locked.
......
6636 6673
 * $value = drupal_array_get_nested_value($form, $parents);
6637 6674
 * @endcode
6638 6675
 *
6639
 * The return value will be NULL, regardless of whether the actual value is NULL
6640
 * or whether the requested key does not exist. If it is required to know
6641
 * whether the nested array key actually exists, pass a third argument that is
6642
 * altered by reference:
6676
 * A return value of NULL is ambiguous, and can mean either that the requested
6677
 * key does not exist, or that the actual value is NULL. If it is required to
6678
 * know whether the nested array key actually exists, pass a third argument that
6679
 * is altered by reference:
6643 6680
 * @code
6644 6681
 * $key_exists = NULL;
6645 6682
 * $value = drupal_array_get_nested_value($form, $parents, $key_exists);
......
7898 7935
  }
7899 7936
}
7900 7937

  
7938
/**
7939
 * Invoke hook_entity_view_mode_alter().
7940
 *
7941
 * If adding a new entity similar to nodes, comments or users, you should invoke
7942
 * this function during the ENTITY_build_content() or ENTITY_view_multiple()
7943
 * phases of rendering to allow other modules to alter the view mode during this
7944
 * phase. This function needs to be called before field_attach_prepare_view() to
7945
 * ensure that the correct content is loaded by field API.
7946
 *
7947
 * @param $entity_type
7948
 *   The type of entity, i.e. 'node', 'user'.
7949
 * @param $entities
7950
 *   The entity objects which are being prepared for view, keyed by object ID.
7951
 * @param $view_mode
7952
 *   The original view mode e.g. 'full', 'teaser'...
7953
 * @param $langcode
7954
 *   (optional) A language code to be used for rendering. Defaults to the global
7955
 *   content language of the current request.
7956
 * @return
7957
 *   An associative array with arrays of entities keyed by view mode.
7958
 *
7959
 * @see hook_entity_view_mode_alter()
7960
 */
7961
function entity_view_mode_prepare($entity_type, $entities, $view_mode, $langcode = NULL) {
7962
  if (!isset($langcode)) {
7963
    $langcode = $GLOBALS['language_content']->language;
7964
  }
7965

  
7966
  // To ensure hooks are never run after field_attach_prepare_view() only
7967
  // process items without the entity_view_prepared flag.
7968
  $entities_by_view_mode = array();
7969
  foreach ($entities as $id => $entity) {
7970
    $entity_view_mode = $view_mode;
7971
    if (empty($entity->entity_view_prepared)) {
7972

  
7973
      // Allow modules to change the view mode.
7974
      $context = array(
7975
        'entity_type' => $entity_type,
7976
        'entity' => $entity,
7977
        'langcode' => $langcode,
7978
      );
7979
      drupal_alter('entity_view_mode', $entity_view_mode, $context);
7980
    }
7981

  
7982
    $entities_by_view_mode[$entity_view_mode][$id] = $entity;
7983
  }
7984

  
7985
  return $entities_by_view_mode;
7986
}
7987

  
7901 7988
/**
7902 7989
 * Returns the URI elements of an entity.
7903 7990
 *
drupal7/includes/database/mysql/schema.inc
40 40
    }
41 41
    else {
42 42
      $db_info = Database::getConnectionInfo();
43
      $info['database'] = $db_info['default']['database'];
43
      $info['database'] = $db_info[$this->connection->getTarget()]['database'];
44 44
      $info['table'] = $table;
45 45
    }
46 46
    return $info;
......
301 301

  
302 302
  public function renameTable($table, $new_name) {
303 303
    if (!$this->tableExists($table)) {
304
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot rename %table to %table_new: table %table doesn't exist.", array('%table' => $table, '%table_new' => $new_name)));
304
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot rename @table to @table_new: table @table doesn't exist.", array('@table' => $table, '@table_new' => $new_name)));
305 305
    }
306 306
    if ($this->tableExists($new_name)) {
307
      throw new DatabaseSchemaObjectExistsException(t("Cannot rename %table to %table_new: table %table_new already exists.", array('%table' => $table, '%table_new' => $new_name)));
307
      throw new DatabaseSchemaObjectExistsException(t("Cannot rename @table to @table_new: table @table_new already exists.", array('@table' => $table, '@table_new' => $new_name)));
308 308
    }
309 309

  
310 310
    $info = $this->getPrefixInfo($new_name);
......
322 322

  
323 323
  public function addField($table, $field, $spec, $keys_new = array()) {
324 324
    if (!$this->tableExists($table)) {
325
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add field %table.%field: table doesn't exist.", array('%field' => $field, '%table' => $table)));
325
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add field @table.@field: table doesn't exist.", array('@field' => $field, '@table' => $table)));
326 326
    }
327 327
    if ($this->fieldExists($table, $field)) {
328
      throw new DatabaseSchemaObjectExistsException(t("Cannot add field %table.%field: field already exists.", array('%field' => $field, '%table' => $table)));
328
      throw new DatabaseSchemaObjectExistsException(t("Cannot add field @table.@field: field already exists.", array('@field' => $field, '@table' => $table)));
329 329
    }
330 330

  
331 331
    $fixnull = FALSE;
......
361 361

  
362 362
  public function fieldSetDefault($table, $field, $default) {
363 363
    if (!$this->fieldExists($table, $field)) {
364
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot set default value of field %table.%field: field doesn't exist.", array('%table' => $table, '%field' => $field)));
364
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot set default value of field @table.@field: field doesn't exist.", array('@table' => $table, '@field' => $field)));
365 365
    }
366 366

  
367 367
    if (!isset($default)) {
......
376 376

  
377 377
  public function fieldSetNoDefault($table, $field) {
378 378
    if (!$this->fieldExists($table, $field)) {
379
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot remove default value of field %table.%field: field doesn't exist.", array('%table' => $table, '%field' => $field)));
379
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot remove default value of field @table.@field: field doesn't exist.", array('@table' => $table, '@field' => $field)));
380 380
    }
381 381

  
382 382
    $this->connection->query('ALTER TABLE {' . $table . '} ALTER COLUMN `' . $field . '` DROP DEFAULT');
......
391 391

  
392 392
  public function addPrimaryKey($table, $fields) {
393 393
    if (!$this->tableExists($table)) {
394
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add primary key to table %table: table doesn't exist.", array('%table' => $table)));
394
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add primary key to table @table: table doesn't exist.", array('@table' => $table)));
395 395
    }
396 396
    if ($this->indexExists($table, 'PRIMARY')) {
397
      throw new DatabaseSchemaObjectExistsException(t("Cannot add primary key to table %table: primary key already exists.", array('%table' => $table)));
397
      throw new DatabaseSchemaObjectExistsException(t("Cannot add primary key to table @table: primary key already exists.", array('@table' => $table)));
398 398
    }
399 399

  
400 400
    $this->connection->query('ALTER TABLE {' . $table . '} ADD PRIMARY KEY (' . $this->createKeySql($fields) . ')');
......
411 411

  
412 412
  public function addUniqueKey($table, $name, $fields) {
413 413
    if (!$this->tableExists($table)) {
414
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add unique key %name to table %table: table doesn't exist.", array('%table' => $table, '%name' => $name)));
414
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add unique key @name to table @table: table doesn't exist.", array('@table' => $table, '@name' => $name)));
415 415
    }
416 416
    if ($this->indexExists($table, $name)) {
417
      throw new DatabaseSchemaObjectExistsException(t("Cannot add unique key %name to table %table: unique key already exists.", array('%table' => $table, '%name' => $name)));
417
      throw new DatabaseSchemaObjectExistsException(t("Cannot add unique key @name to table @table: unique key already exists.", array('@table' => $table, '@name' => $name)));
418 418
    }
419 419

  
420 420
    $this->connection->query('ALTER TABLE {' . $table . '} ADD UNIQUE KEY `' . $name . '` (' . $this->createKeySql($fields) . ')');
......
431 431

  
432 432
  public function addIndex($table, $name, $fields) {
433 433
    if (!$this->tableExists($table)) {
434
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add index %name to table %table: table doesn't exist.", array('%table' => $table, '%name' => $name)));
434
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add index @name to table @table: table doesn't exist.", array('@table' => $table, '@name' => $name)));
435 435
    }
436 436
    if ($this->indexExists($table, $name)) {
437
      throw new DatabaseSchemaObjectExistsException(t("Cannot add index %name to table %table: index already exists.", array('%table' => $table, '%name' => $name)));
437
      throw new DatabaseSchemaObjectExistsException(t("Cannot add index @name to table @table: index already exists.", array('@table' => $table, '@name' => $name)));
438 438
    }
439 439

  
440 440
    $this->connection->query('ALTER TABLE {' . $table . '} ADD INDEX `' . $name . '` (' . $this->createKeySql($fields) . ')');
......
451 451

  
452 452
  public function changeField($table, $field, $field_new, $spec, $keys_new = array()) {
453 453
    if (!$this->fieldExists($table, $field)) {
454
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot change the definition of field %table.%name: field doesn't exist.", array('%table' => $table, '%name' => $field)));
454
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot change the definition of field @table.@name: field doesn't exist.", array('@table' => $table, '@name' => $field)));
455 455
    }
456 456
    if (($field != $field_new) && $this->fieldExists($table, $field_new)) {
457
      throw new DatabaseSchemaObjectExistsException(t("Cannot rename field %table.%name to %name_new: target field already exists.", array('%table' => $table, '%name' => $field, '%name_new' => $field_new)));
457
      throw new DatabaseSchemaObjectExistsException(t("Cannot rename field @table.@name to @name_new: target field already exists.", array('@table' => $table, '@name' => $field, '@name_new' => $field_new)));
458 458
    }
459 459

  
460 460
    $sql = 'ALTER TABLE {' . $table . '} CHANGE `' . $field . '` ' . $this->createFieldSql($field_new, $this->processField($spec));
drupal7/includes/database/pgsql/schema.inc
314 314

  
315 315
  function renameTable($table, $new_name) {
316 316
    if (!$this->tableExists($table)) {
317
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot rename %table to %table_new: table %table doesn't exist.", array('%table' => $table, '%table_new' => $new_name)));
317
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot rename @table to @table_new: table @table doesn't exist.", array('@table' => $table, '@table_new' => $new_name)));
318 318
    }
319 319
    if ($this->tableExists($new_name)) {
320
      throw new DatabaseSchemaObjectExistsException(t("Cannot rename %table to %table_new: table %table_new already exists.", array('%table' => $table, '%table_new' => $new_name)));
320
      throw new DatabaseSchemaObjectExistsException(t("Cannot rename @table to @table_new: table @table_new already exists.", array('@table' => $table, '@table_new' => $new_name)));
321 321
    }
322 322

  
323 323
    // Get the schema and tablename for the old table.
......
351 351

  
352 352
  public function addField($table, $field, $spec, $new_keys = array()) {
353 353
    if (!$this->tableExists($table)) {
354
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add field %table.%field: table doesn't exist.", array('%field' => $field, '%table' => $table)));
354
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add field @table.@field: table doesn't exist.", array('@field' => $field, '@table' => $table)));
355 355
    }
356 356
    if ($this->fieldExists($table, $field)) {
357
      throw new DatabaseSchemaObjectExistsException(t("Cannot add field %table.%field: field already exists.", array('%field' => $field, '%table' => $table)));
357
      throw new DatabaseSchemaObjectExistsException(t("Cannot add field @table.@field: field already exists.", array('@field' => $field, '@table' => $table)));
358 358
    }
359 359

  
360 360
    $fixnull = FALSE;
......
393 393

  
394 394
  public function fieldSetDefault($table, $field, $default) {
395 395
    if (!$this->fieldExists($table, $field)) {
396
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot set default value of field %table.%field: field doesn't exist.", array('%table' => $table, '%field' => $field)));
396
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot set default value of field @table.@field: field doesn't exist.", array('@table' => $table, '@field' => $field)));
397 397
    }
398 398

  
399 399
    if (!isset($default)) {
......
408 408

  
409 409
  public function fieldSetNoDefault($table, $field) {
410 410
    if (!$this->fieldExists($table, $field)) {
411
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot remove default value of field %table.%field: field doesn't exist.", array('%table' => $table, '%field' => $field)));
411
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot remove default value of field @table.@field: field doesn't exist.", array('@table' => $table, '@field' => $field)));
412 412
    }
413 413

  
414 414
    $this->connection->query('ALTER TABLE {' . $table . '} ALTER COLUMN "' . $field . '" DROP DEFAULT');
......
435 435

  
436 436
  public function addPrimaryKey($table, $fields) {
437 437
    if (!$this->tableExists($table)) {
438
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add primary key to table %table: table doesn't exist.", array('%table' => $table)));
438
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add primary key to table @table: table doesn't exist.", array('@table' => $table)));
439 439
    }
440 440
    if ($this->constraintExists($table, 'pkey')) {
441
      throw new DatabaseSchemaObjectExistsException(t("Cannot add primary key to table %table: primary key already exists.", array('%table' => $table)));
441
      throw new DatabaseSchemaObjectExistsException(t("Cannot add primary key to table @table: primary key already exists.", array('@table' => $table)));
442 442
    }
443 443

  
444 444
    $this->connection->query('ALTER TABLE {' . $table . '} ADD PRIMARY KEY (' . implode(',', $fields) . ')');
......
455 455

  
456 456
  function addUniqueKey($table, $name, $fields) {
457 457
    if (!$this->tableExists($table)) {
458
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add unique key %name to table %table: table doesn't exist.", array('%table' => $table, '%name' => $name)));
458
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add unique key @name to table @table: table doesn't exist.", array('@table' => $table, '@name' => $name)));
459 459
    }
460 460
    if ($this->constraintExists($table, $name . '_key')) {
461
      throw new DatabaseSchemaObjectExistsException(t("Cannot add unique key %name to table %table: unique key already exists.", array('%table' => $table, '%name' => $name)));
461
      throw new DatabaseSchemaObjectExistsException(t("Cannot add unique key @name to table @table: unique key already exists.", array('@table' => $table, '@name' => $name)));
462 462
    }
463 463

  
464 464
    $this->connection->query('ALTER TABLE {' . $table . '} ADD CONSTRAINT "' . $this->prefixNonTable($table, $name, 'key') . '" UNIQUE (' . implode(',', $fields) . ')');
......
475 475

  
476 476
  public function addIndex($table, $name, $fields) {
477 477
    if (!$this->tableExists($table)) {
478
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add index %name to table %table: table doesn't exist.", array('%table' => $table, '%name' => $name)));
478
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add index @name to table @table: table doesn't exist.", array('@table' => $table, '@name' => $name)));
479 479
    }
480 480
    if ($this->indexExists($table, $name)) {
481
      throw new DatabaseSchemaObjectExistsException(t("Cannot add index %name to table %table: index already exists.", array('%table' => $table, '%name' => $name)));
481
      throw new DatabaseSchemaObjectExistsException(t("Cannot add index @name to table @table: index already exists.", array('@table' => $table, '@name' => $name)));
482 482
    }
483 483

  
484 484
    $this->connection->query($this->_createIndexSql($table, $name, $fields));
......
495 495

  
496 496
  public function changeField($table, $field, $field_new, $spec, $new_keys = array()) {
497 497
    if (!$this->fieldExists($table, $field)) {
498
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot change the definition of field %table.%name: field doesn't exist.", array('%table' => $table, '%name' => $field)));
498
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot change the definition of field @table.@name: field doesn't exist.", array('@table' => $table, '@name' => $field)));
499 499
    }
500 500
    if (($field != $field_new) && $this->fieldExists($table, $field_new)) {
501
      throw new DatabaseSchemaObjectExistsException(t("Cannot rename field %table.%name to %name_new: target field already exists.", array('%table' => $table, '%name' => $field, '%name_new' => $field_new)));
501
      throw new DatabaseSchemaObjectExistsException(t("Cannot rename field @table.@name to @name_new: target field already exists.", array('@table' => $table, '@name' => $field, '@name_new' => $field_new)));
502 502
    }
503 503

  
504 504
    $spec = $this->processField($spec);
drupal7/includes/database/schema.inc
654 654
   */
655 655
  public function createTable($name, $table) {
656 656
    if ($this->tableExists($name)) {
657
      throw new DatabaseSchemaObjectExistsException(t('Table %name already exists.', array('%name' => $name)));
657
      throw new DatabaseSchemaObjectExistsException(t('Table @name already exists.', array('@name' => $name)));
658 658
    }
659 659
    $statements = $this->createTableSql($name, $table);
660 660
    foreach ($statements as $statement) {
drupal7/includes/database/select.inc
377 377
   * @param $field
378 378
   *   The field on which to order.
379 379
   * @param $direction
380
   *   The direction to sort. Legal values are "ASC" and "DESC".
380
   *   The direction to sort. Legal values are "ASC" and "DESC". Any other value
381
   *   will be converted to "ASC".
381 382
   * @return SelectQueryInterface
382 383
   *   The called object.
383 384
   */
......
1384 1385
  }
1385 1386

  
1386 1387
  public function orderBy($field, $direction = 'ASC') {
1388
    // Only allow ASC and DESC, default to ASC.
1389
    $direction = strtoupper($direction) == 'DESC' ? 'DESC' : 'ASC';
1387 1390
    $this->order[$field] = $direction;
1388 1391
    return $this;
1389 1392
  }
drupal7/includes/database/sqlite/schema.inc
232 232

  
233 233
  public function renameTable($table, $new_name) {
234 234
    if (!$this->tableExists($table)) {
235
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot rename %table to %table_new: table %table doesn't exist.", array('%table' => $table, '%table_new' => $new_name)));
235
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot rename @table to @table_new: table @table doesn't exist.", array('@table' => $table, '@table_new' => $new_name)));
236 236
    }
237 237
    if ($this->tableExists($new_name)) {
238
      throw new DatabaseSchemaObjectExistsException(t("Cannot rename %table to %table_new: table %table_new already exists.", array('%table' => $table, '%table_new' => $new_name)));
238
      throw new DatabaseSchemaObjectExistsException(t("Cannot rename @table to @table_new: table @table_new already exists.", array('@table' => $table, '@table_new' => $new_name)));
239 239
    }
240 240

  
241 241
    $schema = $this->introspectSchema($table);
......
278 278

  
279 279
  public function addField($table, $field, $specification, $keys_new = array()) {
280 280
    if (!$this->tableExists($table)) {
281
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add field %table.%field: table doesn't exist.", array('%field' => $field, '%table' => $table)));
281
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add field @table.@field: table doesn't exist.", array('@field' => $field, '@table' => $table)));
282 282
    }
283 283
    if ($this->fieldExists($table, $field)) {
284
      throw new DatabaseSchemaObjectExistsException(t("Cannot add field %table.%field: field already exists.", array('%field' => $field, '%table' => $table)));
284
      throw new DatabaseSchemaObjectExistsException(t("Cannot add field @table.@field: field already exists.", array('@field' => $field, '@table' => $table)));
285 285
    }
286 286

  
287 287
    // SQLite doesn't have a full-featured ALTER TABLE statement. It only
......
494 494

  
495 495
  public function changeField($table, $field, $field_new, $spec, $keys_new = array()) {
496 496
    if (!$this->fieldExists($table, $field)) {
497
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot change the definition of field %table.%name: field doesn't exist.", array('%table' => $table, '%name' => $field)));
497
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot change the definition of field @table.@name: field doesn't exist.", array('@table' => $table, '@name' => $field)));
498 498
    }
499 499
    if (($field != $field_new) && $this->fieldExists($table, $field_new)) {
500
      throw new DatabaseSchemaObjectExistsException(t("Cannot rename field %table.%name to %name_new: target field already exists.", array('%table' => $table, '%name' => $field, '%name_new' => $field_new)));
500
      throw new DatabaseSchemaObjectExistsException(t("Cannot rename field @table.@name to @name_new: target field already exists.", array('@table' => $table, '@name' => $field, '@name_new' => $field_new)));
501 501
    }
502 502

  
503 503
    $old_schema = $this->introspectSchema($table);
......
559 559

  
560 560
  public function addIndex($table, $name, $fields) {
561 561
    if (!$this->tableExists($table)) {
562
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add index %name to table %table: table doesn't exist.", array('%table' => $table, '%name' => $name)));
562
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add index @name to table @table: table doesn't exist.", array('@table' => $table, '@name' => $name)));
563 563
    }
564 564
    if ($this->indexExists($table, $name)) {
565
      throw new DatabaseSchemaObjectExistsException(t("Cannot add index %name to table %table: index already exists.", array('%table' => $table, '%name' => $name)));
565
      throw new DatabaseSchemaObjectExistsException(t("Cannot add index @name to table @table: index already exists.", array('@table' => $table, '@name' => $name)));
566 566
    }
567 567

  
568 568
    $schema['indexes'][$name] = $fields;
......
591 591

  
592 592
  public function addUniqueKey($table, $name, $fields) {
593 593
    if (!$this->tableExists($table)) {
594
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add unique key %name to table %table: table doesn't exist.", array('%table' => $table, '%name' => $name)));
594
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add unique key @name to table @table: table doesn't exist.", array('@table' => $table, '@name' => $name)));
595 595
    }
596 596
    if ($this->indexExists($table, $name)) {
597
      throw new DatabaseSchemaObjectExistsException(t("Cannot add unique key %name to table %table: unique key already exists.", array('%table' => $table, '%name' => $name)));
597
      throw new DatabaseSchemaObjectExistsException(t("Cannot add unique key @name to table @table: unique key already exists.", array('@table' => $table, '@name' => $name)));
598 598
    }
599 599

  
600 600
    $schema['unique keys'][$name] = $fields;
......
617 617

  
618 618
  public function addPrimaryKey($table, $fields) {
619 619
    if (!$this->tableExists($table)) {
620
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add primary key to table %table: table doesn't exist.", array('%table' => $table)));
620
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add primary key to table @table: table doesn't exist.", array('@table' => $table)));
621 621
    }
622 622

  
623 623
    $old_schema = $this->introspectSchema($table);
624 624
    $new_schema = $old_schema;
625 625

  
626 626
    if (!empty($new_schema['primary key'])) {
627
      throw new DatabaseSchemaObjectExistsException(t("Cannot add primary key to table %table: primary key already exists.", array('%table' => $table)));
627
      throw new DatabaseSchemaObjectExistsException(t("Cannot add primary key to table @table: primary key already exists.", array('@table' => $table)));
628 628
    }
629 629

  
630 630
    $new_schema['primary key'] = $fields;
......
646 646

  
647 647
  public function fieldSetDefault($table, $field, $default) {
648 648
    if (!$this->fieldExists($table, $field)) {
649
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot set default value of field %table.%field: field doesn't exist.", array('%table' => $table, '%field' => $field)));
649
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot set default value of field @table.@field: field doesn't exist.", array('@table' => $table, '@field' => $field)));
650 650
    }
651 651

  
652 652
    $old_schema = $this->introspectSchema($table);
......
658 658

  
659 659
  public function fieldSetNoDefault($table, $field) {
660 660
    if (!$this->fieldExists($table, $field)) {
661
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot remove default value of field %table.%field: field doesn't exist.", array('%table' => $table, '%field' => $field)));
661
      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot remove default value of field @table.@field: field doesn't exist.", array('@table' => $table, '@field' => $field)));
662 662
    }
663 663

  
664 664
    $old_schema = $this->introspectSchema($table);
drupal7/includes/file.inc
1152 1152
    // Remove any null bytes. See http://php.net/manual/security.filesystem.nullbytes.php
1153 1153
    $filename = str_replace(chr(0), '', $filename);
1154 1154

  
1155
    $whitelist = array_unique(explode(' ', trim($extensions)));
1155
    $whitelist = array_unique(explode(' ', strtolower(trim($extensions))));
1156 1156

  
1157 1157
    // Split the filename up by periods. The first part becomes the basename
1158 1158
    // the last part the final extension.
......
1165 1165
    // of allowed extensions.
1166 1166
    foreach ($filename_parts as $filename_part) {
1167 1167
      $new_filename .= '.' . $filename_part;
1168
      if (!in_array($filename_part, $whitelist) && preg_match("/^[a-zA-Z]{2,5}\d?$/", $filename_part)) {
1168
      if (!in_array(strtolower($filename_part), $whitelist) && preg_match("/^[a-zA-Z]{2,5}\d?$/", $filename_part)) {
1169 1169
        $new_filename .= '_';
1170 1170
      }
1171 1171
    }
......
1729 1729
/**
1730 1730
 * Checks that the file's size is below certain limits.
1731 1731
 *
1732
 * This check is not enforced for the user #1.
1733
 *
1734 1732
 * @param $file
1735 1733
 *   A Drupal file object.
1736 1734
 * @param $file_limit
......
1748 1746
 */
1749 1747
function file_validate_size(stdClass $file, $file_limit = 0, $user_limit = 0) {
1750 1748
  global $user;
1751

  
1752 1749
  $errors = array();
1753 1750

  
1754
  // Bypass validation for uid  = 1.
1755
  if ($user->uid != 1) {
1756
    if ($file_limit && $file->filesize > $file_limit) {
1757
      $errors[] = t('The file is %filesize exceeding the maximum file size of %maxsize.', array('%filesize' => format_size($file->filesize), '%maxsize' => format_size($file_limit)));
1758
    }
1751
  if ($file_limit && $file->filesize > $file_limit) {
1752
    $errors[] = t('The file is %filesize exceeding the maximum file size of %maxsize.', array('%filesize' => format_size($file->filesize), '%maxsize' => format_size($file_limit)));
1753
  }
1759 1754

  
1760
    // Save a query by only calling file_space_used() when a limit is provided.
1761
    if ($user_limit && (file_space_used($user->uid) + $file->filesize) > $user_limit) {
1762
      $errors[] = t('The file is %filesize which would exceed your disk quota of %quota.', array('%filesize' => format_size($file->filesize), '%quota' => format_size($user_limit)));
1763
    }
1755
  // Save a query by only calling file_space_used() when a limit is provided.
1756
  if ($user_limit && (file_space_used($user->uid) + $file->filesize) > $user_limit) {
1757
    $errors[] = t('The file is %filesize which would exceed your disk quota of %quota.', array('%filesize' => format_size($file->filesize), '%quota' => format_size($user_limit)));
1764 1758
  }
1759

  
1765 1760
  return $errors;
1766 1761
}
1767 1762

  
drupal7/includes/file.mimetypes.inc
43 43
      4 => 'application/cap',
44 44
      5 => 'application/cu-seeme',
45 45
      6 => 'application/dsptype',
46
      350 => 'application/epub+zip',
46 47
      7 => 'application/hta',
47 48
      8 => 'application/java-archive',
48 49
      9 => 'application/java-serialized-object',
......
64 65
      25 => 'application/rss+xml',
65 66
      26 => 'application/rtf',
66 67
      27 => 'application/smil',
68
      349 => 'application/vnd.amazon.ebook',
67 69
      28 => 'application/vnd.cinderella',
68 70
      29 => 'application/vnd.google-earth.kml+xml',
69 71
      30 => 'application/vnd.google-earth.kmz',
......
183 185
      144 => 'application/x-lzx',
184 186
      145 => 'application/x-maker',
185 187
      146 => 'application/x-mif',
188
      351 => 'application/x-mobipocket-ebook',
189
      352 => 'application/x-mobipocket-ebook',
186 190
      147 => 'application/x-ms-wmd',
187 191
      148 => 'application/x-ms-wmz',
188 192
      149 => 'application/x-msdos-program',
......
228 232
      188 => 'audio/mpeg',
229 233
      189 => 'audio/ogg',
230 234
      190 => 'audio/prs.sid',
235
      356 => 'audio/webm',
231 236
      191 => 'audio/x-aiff',
232 237
      192 => 'audio/x-gsm',
238
      354 => 'audio/x-matroska',
233 239
      193 => 'audio/x-mpegurl',
234 240
      194 => 'audio/x-ms-wax',
235 241
      195 => 'audio/x-ms-wma',
......
301 307
      261 => 'image/vnd.djvu',
302 308
      262 => 'image/vnd.microsoft.icon',
303 309
      263 => 'image/vnd.wap.wbmp',
310
      355 => 'image/webp',
304 311
      264 => 'image/x-cmu-raster',
305 312
      265 => 'image/x-coreldraw',
306 313
      266 => 'image/x-coreldrawpattern',
......
337 344
      297 => 'text/vnd.sun.j2me.app-descriptor',
338 345
      298 => 'text/vnd.wap.wml',
339 346
      299 => 'text/vnd.wap.wmlscript',
347
      358 => 'text/vtt',
340 348
      300 => 'text/x-bibtex',
341 349
      301 => 'text/x-boo',
342 350
      302 => 'text/x-c++hdr',
......
371 379
      331 => 'video/ogg',
372 380
      332 => 'video/quicktime',
373 381
      333 => 'video/vnd.mpegurl',
382
      357 => 'video/webm',
374 383
      347 => 'video/x-flv',
375 384
      334 => 'video/x-la-asf',
376 385
      348 => 'video/x-m4v',
386
      353 => 'video/x-matroska',
377 387
      335 => 'video/x-mng',
378 388
      336 => 'video/x-ms-asf',
379 389
      337 => 'video/x-ms-wm',
......
854 864
      'f4b' => 346,
855 865
      'flv' => 347,
856 866
      'm4v' => 348,
867
      'azw' => 349,
868
      'epub' => 350,
869
      'mobi' => 351,
870
      'prc' => 352,
871
      'mkv' => 353,
872
      'mka' => 354,
873
      'webp' => 355,
874
      'weba' => 356,
875
      'webm' => 357,
876
      'vtt' => 358,
857 877
    ),
858 878
  );
859 879
}
drupal7/includes/filetransfer/ssh.inc
72 72
        return TRUE;
73 73
      }
74 74
      return FALSE;
75
    } else {
75
    }
76
    else {
76 77
      throw new FileTransferException('Cannot check @path.', NULL, array('@path' => $path));
77 78
    }
78 79
  }
......
85 86
        return TRUE;
86 87
      }
87 88
      return FALSE;
88
    } else {
89
    }
90
    else {
89 91
      throw new FileTransferException('Cannot check @path.', NULL, array('@path' => $path));
90 92
    }
91 93
  }
drupal7/includes/form.inc
2699 2699
}
2700 2700

  
2701 2701
/**
2702
 * Converts a select form element's options array into HTML.
2703
 *
2704
 * @param $element
2705
 *   An associative array containing the properties of the element.
2706
 * @param $choices
2707
 *   Mixed: Either an associative array of items to list as choices, or an
2708
 *   object with an 'option' member that is an associative array. This
2709
 *   parameter is only used internally and should not be passed.
2710
 *
2711
 * @return
2712
 *   An HTML string of options for the select form element.
2702
 * Converts an array of options into HTML, for use in select list form elements.
2703
 *
2704
 * This function calls itself recursively to obtain the values for each optgroup
2705
 * within the list of options and when the function encounters an object with
2706
 * an 'options' property inside $element['#options'].
2707
 *
2708
 * @param array $element
2709
 *   An associative array containing the following key-value pairs:
2710
 *   - #multiple: Optional Boolean indicating if the user may select more than
2711
 *     one item.
2712
 *   - #options: An associative array of options to render as HTML. Each array
2713
 *     value can be a string, an array, or an object with an 'option' property:
2714
 *     - A string or integer key whose value is a translated string is
2715
 *       interpreted as a single HTML option element. Do not use placeholders
2716
 *       that sanitize data: doing so will lead to double-escaping. Note that
2717
 *       the key will be visible in the HTML and could be modified by malicious
2718
 *       users, so don't put sensitive information in it.
2719
 *     - A translated string key whose value is an array indicates a group of
2720
 *       options. The translated string is used as the label attribute for the
2721
 *       optgroup. Do not use placeholders to sanitize data: doing so will lead
2722
 *       to double-escaping. The array should contain the options you wish to
2723
 *       group and should follow the syntax of $element['#options'].
2724
 *     - If the function encounters a string or integer key whose value is an
2725
 *       object with an 'option' property, the key is ignored, the contents of
2726
 *       the option property are interpreted as $element['#options'], and the
2727
 *       resulting HTML is added to the output.
2728
 *   - #value: Optional integer, string, or array representing which option(s)
2729
 *     to pre-select when the list is first displayed. The integer or string
2730
 *     must match the key of an option in the '#options' list. If '#multiple' is
2731
 *     TRUE, this can be an array of integers or strings.
2732
 * @param array|null $choices
2733
 *   (optional) Either an associative array of options in the same format as
2734
 *   $element['#options'] above, or NULL. This parameter is only used internally
2735
 *   and is not intended to be passed in to the initial function call.
2736
 *
2737
 * @return string
2738
 *   An HTML string of options and optgroups for use in a select form element.
2713 2739
 */
2714 2740
function form_select_options($element, $choices = NULL) {
2715 2741
  if (!isset($choices)) {
......
3285 3311
 */
3286 3312
function theme_container($variables) {
3287 3313
  $element = $variables['element'];
3314
  // Ensure #attributes is set.
3315
  $element += array('#attributes' => array());
3288 3316

  
3289 3317
  // Special handling for form elements.
3290 3318
  if (isset($element['#array_parents'])) {
drupal7/includes/install.inc
420 420
      }
421 421
    }
422 422
    if (!empty($message)) {
423
      $message = '<p>In order for Drupal to work, and to continue with the installation process, you must resolve all issues reported below. For more help with configuring your database server, see the <a href="http://drupal.org/getting-started/install">installation handbook</a>. If you are unsure what any of this means you should probably contact your hosting provider.</p>' . $message;
423
      $message = 'Resolve all issues below to continue the installation. For help configuring your database server, see the <a href="http://drupal.org/getting-started/install">installation handbook</a>, or contact your hosting provider.' . $message;
424 424
      throw new DatabaseTaskException($message);
425 425
    }
426 426
  }
drupal7/includes/locale.inc
398 398
      $links[$langcode]['query'][$param] = $langcode;
399 399
    }
400 400
    else {
401
      $links[$langcode]['attributes']['class'][] = ' session-active';
401
      $links[$langcode]['attributes']['class'][] = 'session-active';
402 402
    }
403 403
  }
404 404

  
drupal7/includes/lock.inc
92 92
 * Acquire (or renew) a lock, but do not block if it fails.
93 93
 *
94 94
 * @param $name
95
 *   The name of the lock.
95
 *   The name of the lock. Limit of name's length is 255 characters.
96 96
 * @param $timeout
97 97
 *   A number of seconds (float) before the lock expires (minimum of 0.001).
98 98
 *
drupal7/includes/mail.inc
10 10
 *
11 11
 * $conf['mail_line_endings'] will override this setting.
12 12
 */
13
define('MAIL_LINE_ENDINGS', isset($_SERVER['WINDIR']) || strpos($_SERVER['SERVER_SOFTWARE'], 'Win32') !== FALSE ? "\r\n" : "\n");
13
define('MAIL_LINE_ENDINGS', isset($_SERVER['WINDIR']) || (isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'], 'Win32') !== FALSE) ? "\r\n" : "\n");
14 14

  
15 15
/**
16 16
 * Composes and optionally sends an e-mail message.
drupal7/includes/menu.inc
2495 2495
    $query->addField('ml', 'weight', 'link_weight');
2496 2496
    $query->fields('m');
2497 2497
    $query->condition('ml.link_path', $path_candidates, 'IN');
2498
    $query->addTag('preferred_menu_links');
2498 2499

  
2499 2500
    // Sort candidates by link path and menu name.
2500 2501
    $candidates = array();
drupal7/includes/tablesort.inc
46 46
      // Based on code from db_escape_table(), but this can also contain a dot.
47 47
      $field = preg_replace('/[^A-Za-z0-9_.]+/', '', $ts['sql']);
48 48

  
49
      // Sort order can only be ASC or DESC.
50
      $sort = drupal_strtoupper($ts['sort']);
51
      $sort = in_array($sort, array('ASC', 'DESC')) ? $sort : '';
52
      $this->orderBy($field, $sort);
49
      // orderBy() will ensure that only ASC/DESC values are accepted, so we
50
      // don't need to sanitize that here.
51
      $this->orderBy($field, $ts['sort']);
53 52
    }
54 53
    return $this;
55 54
  }
drupal7/includes/theme.inc
1029 1029
    }
1030 1030
    $hook = $candidate;
1031 1031
  }
1032
  $theme_hook_original = $hook;
1032 1033

  
1033 1034
  // If there's no implementation, check for more generic fallbacks. If there's
1034 1035
  // still no implementation, log an error and return an empty string.
......
1090 1091
    $variables += array($info['render element'] => array());
1091 1092
  }
1092 1093

  
1094
  $variables['theme_hook_original'] = $theme_hook_original;
1095

  
1093 1096
  // Invoke the variable processors, if any. The processors may specify
1094 1097
  // alternate suggestions for which hook's template/function to use. If the
1095 1098
  // hook is a suggestion of a base hook, invoke the variable processors of
......
1198 1201
    if (isset($info['path'])) {
1199 1202
      $template_file = $info['path'] . '/' . $template_file;
1200 1203
    }
1201
    $output = $render_function($template_file, $variables);
1204
    if (variable_get('theme_debug', FALSE)) {
1205
      $output = _theme_render_template_debug($render_function, $template_file, $variables, $extension);
1206
    }
1207
    else {
1208
      $output = $render_function($template_file, $variables);
1209
    }
1202 1210
  }
1203 1211

  
1204 1212
  // restore path_to_theme()
......
1520 1528
  return ob_get_clean();
1521 1529
}
1522 1530

  
1531
/**
1532
 * Renders a template for any engine.
1533
 *
1534
 * Includes the possibility to get debug output by setting the
1535
 * theme_debug variable to TRUE.
1536
 *
1537
 * @param string $template_function
1538
 *   The function to call for rendering the template.
1539
 * @param string $template_file
1540
 *   The filename of the template to render.
1541
 * @param array $variables
1542
 *   A keyed array of variables that will appear in the output.
1543
 * @param string $extension
1544
 *   The extension used by the theme engine for template files.
1545
 *
1546
 * @return string
1547
 *   The output generated by the template including debug information.
1548
 */
1549
function _theme_render_template_debug($template_function, $template_file, $variables, $extension) {
1550
  $output = array(
1551
    'debug_prefix' => '',
1552
    'debug_info' => '',
1553
    'rendered_markup' => call_user_func($template_function, $template_file, $variables),
1554
    'debug_suffix' => '',
1555
  );
1556
  $output['debug_prefix'] .= "\n\n<!-- THEME DEBUG -->";
1557
  $output['debug_prefix'] .= "\n<!-- CALL: theme('" . check_plain($variables['theme_hook_original']) . "') -->";
1558
  // If there are theme suggestions, reverse the array so more specific
1559
  // suggestions are shown first.
1560
  if (!empty($variables['theme_hook_suggestions'])) {
1561
    $variables['theme_hook_suggestions'] = array_reverse($variables['theme_hook_suggestions']);
1562
  }
1563
  // Add debug output for directly called suggestions like
1564
  // '#theme' => 'comment__node__article'.
1565
  if (strpos($variables['theme_hook_original'], '__') !== FALSE) {
1566
    $derived_suggestions[] = $hook = $variables['theme_hook_original'];
1567
    while ($pos = strrpos($hook, '__')) {
1568
      $hook = substr($hook, 0, $pos);
1569
      $derived_suggestions[] = $hook;
1570
    }
1571
    // Get the value of the base hook (last derived suggestion) and append it
1572
    // to the end of all theme suggestions.
1573
    $base_hook = array_pop($derived_suggestions);
1574
    $variables['theme_hook_suggestions'] = array_merge($derived_suggestions, $variables['theme_hook_suggestions']);
1575
    $variables['theme_hook_suggestions'][] = $base_hook;
1576
  }
1577
  if (!empty($variables['theme_hook_suggestions'])) {
1578
    $current_template = basename($template_file);
1579
    $suggestions = $variables['theme_hook_suggestions'];
1580
    // Only add the original theme hook if it wasn't a directly called
1581
    // suggestion.
1582
    if (strpos($variables['theme_hook_original'], '__') === FALSE) {
1583
      $suggestions[] = $variables['theme_hook_original'];
1584
    }
1585
    foreach ($suggestions as &$suggestion) {
1586
      $template = strtr($suggestion, '_', '-') . $extension;
1587
      $prefix = ($template == $current_template) ? 'x' : '*';
1588
      $suggestion = $prefix . ' ' . $template;
1589
    }
1590
    $output['debug_info'] .= "\n<!-- FILE NAME SUGGESTIONS:\n   " . check_plain(implode("\n   ", $suggestions)) . "\n-->";
1591
  }
1592
  $output['debug_info'] .= "\n<!-- BEGIN OUTPUT from '" . check_plain($template_file) . "' -->\n";
1593
  $output['debug_suffix'] .= "\n<!-- END OUTPUT from '" . check_plain($template_file) . "' -->\n\n";
1594
  return implode('', $output);
1595
}
1596

  
1523 1597
/**
1524 1598
 * Enables a given list of themes.
1525 1599
 *
......
1690 1764
  $output = '';
1691 1765

  
1692 1766
  if (count($links) > 0) {
1693
    $output = '';
1694

  
1695 1767
    // Treat the heading first if it is present to prepend it to the
1696 1768
    // list of links.
1697 1769
    if (!empty($heading)) {
drupal7/includes/unicode.inc
116 116
  if (ini_get('mbstring.encoding_translation') != 0) {
117 117
    return array(UNICODE_ERROR, $t('Multibyte string input conversion in PHP is active and must be disabled. Check the php.ini <em>mbstring.encoding_translation</em> setting. Please refer to the <a href="@url">PHP mbstring documentation</a> for more information.', array('@url' => 'http://www.php.net/mbstring')));
118 118
  }
119
  if (ini_get('mbstring.http_input') != 'pass') {
120
    return array(UNICODE_ERROR, $t('Multibyte string input conversion in PHP is active and must be disabled. Check the php.ini <em>mbstring.http_input</em> setting. Please refer to the <a href="@url">PHP mbstring documentation</a> for more information.', array('@url' => 'http://www.php.net/mbstring')));
121
  }
122
  if (ini_get('mbstring.http_output') != 'pass') {
123
    return array(UNICODE_ERROR, $t('Multibyte string output conversion in PHP is active and must be disabled. Check the php.ini <em>mbstring.http_output</em> setting. Please refer to the <a href="@url">PHP mbstring documentation</a> for more information.', array('@url' => 'http://www.php.net/mbstring')));
119
  // mbstring.http_input and mbstring.http_output are deprecated and empty by
120
  // default in PHP 5.6.
121
  if (version_compare(PHP_VERSION, '5.6.0') == -1) {
122
    if (ini_get('mbstring.http_input') != 'pass') {
123
      return array(UNICODE_ERROR, $t('Multibyte string input conversion in PHP is active and must be disabled. Check the php.ini <em>mbstring.http_input</em> setting. Please refer to the <a href="@url">PHP mbstring documentation</a> for more information.', array('@url' => 'http://www.php.net/mbstring')));
124
    }
125
    if (ini_get('mbstring.http_output') != 'pass') {
126
      return array(UNICODE_ERROR, $t('Multibyte string output conversion in PHP is active and must be disabled. Check the php.ini <em>mbstring.http_output</em> setting. Please refer to the <a href="@url">PHP mbstring documentation</a> for more information.', array('@url' => 'http://www.php.net/mbstring')));
127
    }
124 128
  }
125 129

  
126 130
  // Set appropriate configuration
drupal7/misc/ajax.js
618 618
      .filter(':odd').addClass('even');
619 619
  },
620 620

  
621
  /**
622
   * Command to add css.
623
   *
624
   * Uses the proprietary addImport method if available as browsers which
625
   * support that method ignore @import statements in dynamically added
626
   * stylesheets.
627
   */
628
  add_css: function (ajax, response, status) {
629
    // Add the styles in the normal way.
630
    $('head').prepend(response.data);
631
    // Add imports in the styles using the addImport method if available.
632
    var match, importMatch = /^@import url\("(.*)"\);$/igm;
633
    if (document.styleSheets[0].addImport && importMatch.test(response.data)) {
634
      importMatch.lastIndex = 0;
635
      while (match = importMatch.exec(response.data)) {
636
        document.styleSheets[0].addImport(match[1]);
637
      }
638
    }
639
  },
640

  
621 641
  /**
622 642
   * Command to update a form's build ID.
623 643
   */
drupal7/modules/aggregator/aggregator.fetcher.inc
27 27
    $headers['If-None-Match'] = $feed->etag;
28 28
  }
29 29
  if ($feed->modified) {
30
    $headers['If-Modified-Since'] = gmdate(DATE_RFC1123, $feed->modified);
30
    $headers['If-Modified-Since'] = gmdate(DATE_RFC7231, $feed->modified);
31 31
  }
32 32

  
33 33
  // Request feed.
drupal7/modules/aggregator/aggregator.info
7 7
configure = admin/config/services/aggregator/settings
8 8
stylesheets[all][] = aggregator.css
9 9

  
10
; Information added by Drupal.org packaging script on 2014-10-15
11
version = "7.32"
10
; Information added by Drupal.org packaging script on 2014-11-07
11
version = "7.33"
12 12
project = "drupal"
13
datestamp = "1413387510"
13
datestamp = "1415375131"
14 14

  
drupal7/modules/aggregator/tests/aggregator_test.info
5 5
core = 7.x
6 6
hidden = TRUE
7 7

  
8
; Information added by Drupal.org packaging script on 2014-10-15
9
version = "7.32"
8
; Information added by Drupal.org packaging script on 2014-11-07
9
version = "7.33"
10 10
project = "drupal"
11
datestamp = "1413387510"
11
datestamp = "1415375131"
12 12

  
drupal7/modules/aggregator/tests/aggregator_test.module
32 32
  // Send appropriate response. We respond with a 304 not modified on either
33 33
  // etag or on last modified.
34 34
  if ($use_last_modified) {
35
    drupal_add_http_header('Last-Modified', gmdate(DATE_RFC1123, $last_modified));
35
    drupal_add_http_header('Last-Modified', gmdate(DATE_RFC7231, $last_modified));
36 36
  }
37 37
  if ($use_etag) {
38 38
    drupal_add_http_header('ETag', $etag);
drupal7/modules/block/block.admin.inc
272 272
  $form['settings']['title'] = array(
273 273
    '#type' => 'textfield',
274 274
    '#title' => t('Block title'),
275
    '#maxlength' => 64,
275
    '#maxlength' => 255,
276 276
    '#description' => $block->module == 'block' ? t('The title of the block as shown to the user.') : t('Override the default title for the block. Use <em>!placeholder</em> to display no title, or leave blank to use the default block title.', array('!placeholder' => '&lt;none&gt;')),
277 277
    '#default_value' => isset($block->title) ? $block->title : '',
278 278
    '#weight' => -19,
drupal7/modules/block/block.info
6 6
files[] = block.test
7 7
configure = admin/structure/block
8 8

  
9
; Information added by Drupal.org packaging script on 2014-10-15
10
version = "7.32"
9
; Information added by Drupal.org packaging script on 2014-11-07
10
version = "7.33"
11 11
project = "drupal"
12
datestamp = "1413387510"
12
datestamp = "1415375131"
13 13

  
drupal7/modules/block/block.install
79 79
      ),
80 80
      'title' => array(
81 81
        'type' => 'varchar',
82
        'length' => 64,
82
        'length' => 255,
83 83
        'not null' => TRUE,
84 84
        'default' => '',
85 85
        'description' => 'Custom title for the block. (Empty string will use block default title, <none> will remove the title, text will cause block to use specified title.)',
......
472 472
  db_drop_field('block', 'throttle');
473 473
}
474 474

  
475
/**
476
 * Increase {block}.title length to 255 characters.
477
 */
478
function block_update_7009() {
479
  db_change_field('block', 'title', 'title',
480
    array(
481
      'type' => 'varchar',
482
      'length' => 255,
483
      'not null' => TRUE,
484
      'default' => '',
485
      'description' => 'Custom title for the block. (Empty string will use block default title, <none> will remove the title, text will cause block to use specified title.)',
486
      'translatable' => TRUE,
487
    )
488
  );
489
}
490

  
475 491
/**
476 492
 * @} End of "addtogroup updates-7.x-extra".
477 493
 */
drupal7/modules/block/block.module
848 848
 *   An array of visible blocks as expected by drupal_render().
849 849
 */
850 850
function _block_render_blocks($region_blocks) {
851
  // Block caching is not compatible with node access modules. We also
852
  // preserve the submission of forms in blocks, by fetching from cache only
851
  $cacheable = TRUE;
852

  
853
  // We preserve the submission of forms in blocks, by fetching from cache only
853 854
  // if the request method is 'GET' (or 'HEAD').
854
  $cacheable = !count(module_implements('node_grants')) && ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'HEAD');
855
  if ($_SERVER['REQUEST_METHOD'] != 'GET' && $_SERVER['REQUEST_METHOD'] != 'HEAD') {
856
    $cacheable = FALSE;
857
  }
858
  // Block caching is not usually compatible with node access modules, so by
859
  // default it is disabled when node access modules exist. However, it can be
860
  // allowed by using the variable 'block_cache_bypass_node_grants'.
861
  elseif (!variable_get('block_cache_bypass_node_grants', FALSE) && count(module_implements('node_grants'))) {
862
    $cacheable = FALSE;
863
  }
855 864

  
856 865
  // Proceed to loop over all blocks in order to compute their respective cache
... Ce différentiel a été tronqué car il excède la taille maximale pouvant être affichée.

Formats disponibles : Unified diff