Skip to content

Commit e4febb7

Browse files
committed
Merge branch '7.x' into 7.x-symfony
Conflicts: modules/image/image.module
2 parents 552b469 + 76faa7d commit e4febb7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+726
-170
lines changed

CHANGELOG.txt

+42-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,48 @@
11

2-
Drupal 7.33, xxxx-xx-xx (development version)
2+
Drupal 7.34, xxxx-xx-xx (development version)
33
-----------------------
4+
5+
Drupal 7.33, 2014-11-07
6+
-----------------------
7+
- Began storing the file modification time of each module and theme in the
8+
{system} database table so that contributed modules can use it to identify
9+
recently changed modules and themes (minor data structure change to the
10+
return value of system_get_info() and other related functions).
11+
- Added a "Did you mean?" feature to the run-tests.sh script for running
12+
automated tests from the command line, to help developers who are attempting
13+
to run a particular test class or group.
14+
- Changed the date format used in various HTTP headers output by Drupal core
15+
from RFC 1123 format to RFC 7231 format.
16+
- Added a "block_cache_bypass_node_grants" variable to allow sites which have
17+
node access modules enabled to use the block cache if desired (API addition).
18+
- Made image derivative generation HTTP requests return a 404 error (rather
19+
than a 500 error) when the source image does not exist.
20+
- Fixed a bug which caused user pictures to be removed from the user object
21+
after saving, and resulted in data loss if the user account was subsequently
22+
re-saved.
23+
- Fixed a bug in which field_has_data() did not return TRUE for fields that
24+
only had data in older entity revisions, leading to loss of the field's data
25+
when the field configuration was edited.
26+
- Fixed a bug which caused the Ajax progress throbber to appear misaligned in
27+
many situatons (minor styling change).
28+
- Prevented the Bartik theme from lower-casing the "Permalink" link on
29+
comments, for improved multilingual support (minor UI change).
30+
- Added a "preferred_menu_links" tag to the database query that is used by
31+
menu_link_get_preferred() to find the preferred menu link for a given path,
32+
to make it easier to alter.
33+
- Increased the maximum allowed length of block titles to 255 characters
34+
(database schema change to the {block} table).
35+
- Removed the Field module's field_modules_uninstalled() function, since it did
36+
not do anything when it was invoked.
437
- Added a "theme_hook_original" variable to templates and theme functions and
538
an optional sitewide theme debug mode, to provide contextual information in
6-
the page's HTML to theme developers (API addition).
39+
the page's HTML to theme developers. The theme debug mode is based on the one
40+
used with Twig in Drupal 8 and can be accessed by setting the "theme_debug"
41+
variable to TRUE (API addition).
742
- Added an entity_view_mode_prepare() API function to allow entity-defining
843
modules to properly invoke hook_entity_view_mode_alter(), and used it
9-
throughout Drupal core to fix bugs with the invocation of that hook.
44+
throughout Drupal core to fix bugs with the invocation of that hook (API
45+
change: https://www.drupal.org/node/2369141).
1046
- Security improvement: Made the database API's orderBy() method sanitize the
1147
sort direction ("ASC" or "DESC") for queries built with db_select(), so that
1248
calling code does not have to.
@@ -27,6 +63,9 @@ Drupal 7.33, xxxx-xx-xx (development version)
2763
hook_query_alter() on these queries).
2864
- Removed special-case behavior for file uploads which allowed user #1 to
2965
bypass maximum file size and user quota limits.
66+
- Numerous small bug fixes.
67+
- Numerous API documentation improvements.
68+
- Additional automated test coverage.
3069

3170
Drupal 7.32, 2014-10-15
3271
----------------------

includes/ajax.inc

+24-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ function ajax_render($commands = array()) {
276276

277277
$extra_commands = array();
278278
if (!empty($styles)) {
279-
$extra_commands[] = ajax_command_prepend('head', $styles);
279+
$extra_commands[] = ajax_command_add_css($styles);
280280
}
281281
if (!empty($scripts_header)) {
282282
$extra_commands[] = ajax_command_prepend('head', $scripts_header);
@@ -1257,3 +1257,26 @@ function ajax_command_update_build_id($form) {
12571257
'new' => $form['#build_id'],
12581258
);
12591259
}
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+
}

includes/bootstrap.inc

+18-8
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/**
99
* The current system version.
1010
*/
11-
define('VERSION', '7.33-dev');
11+
define('VERSION', '7.34-dev');
1212

1313
/**
1414
* Core API compatibility.
@@ -248,6 +248,15 @@ define('REGISTRY_WRITE_LOOKUP_CACHE', 2);
248248
*/
249249
define('DRUPAL_PHP_FUNCTION_PATTERN', '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*');
250250

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+
251260
/**
252261
* Provides a caching wrapper to be used in place of large array structures.
253262
*
@@ -852,7 +861,7 @@ function drupal_get_filename($type, $name, $filename = NULL) {
852861
try {
853862
if (function_exists('db_query')) {
854863
$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)) {
856865
$files[$type][$name] = $file;
857866
}
858867
}
@@ -1243,7 +1252,7 @@ function drupal_page_header() {
12431252

12441253
$default_headers = array(
12451254
'Expires' => 'Sun, 19 Nov 1978 05:00:00 GMT',
1246-
'Last-Modified' => gmdate(DATE_RFC1123, REQUEST_TIME),
1255+
'Last-Modified' => gmdate(DATE_RFC7231, REQUEST_TIME),
12471256
'Cache-Control' => 'no-cache, must-revalidate, post-check=0, pre-check=0',
12481257
'ETag' => '"' . REQUEST_TIME . '"',
12491258
);
@@ -1313,7 +1322,7 @@ function drupal_serve_page_from_cache(stdClass $cache) {
13131322
drupal_add_http_header($name, $value);
13141323
}
13151324

1316-
$default_headers['Last-Modified'] = gmdate(DATE_RFC1123, $cache->created);
1325+
$default_headers['Last-Modified'] = gmdate(DATE_RFC7231, $cache->created);
13171326

13181327
// HTTP/1.0 proxies does not support the Vary header, so prevent any caching
13191328
// by sending an Expires date in the past. HTTP/1.1 clients ignores the
@@ -1536,12 +1545,13 @@ function format_string($string, array $args = array()) {
15361545
* Also validates strings as UTF-8 to prevent cross site scripting attacks on
15371546
* Internet Explorer 6.
15381547
*
1539-
* @param $text
1548+
* @param string $text
15401549
* The text to be checked or processed.
15411550
*
1542-
* @return
1543-
* An HTML safe version of $text, or an empty string if $text is not
1544-
* valid UTF-8.
1551+
* @return string
1552+
* An HTML safe version of $text. If $text is not valid UTF-8, an empty string
1553+
* is returned and, on PHP < 5.4, a warning may be issued depending on server
1554+
* configuration (see @link https://bugs.php.net/bug.php?id=47494 @endlink).
15451555
*
15461556
* @see drupal_validate_utf8()
15471557
* @ingroup sanitization

includes/common.inc

+12-7
Original file line numberDiff line numberDiff line change
@@ -3472,7 +3472,11 @@ function drupal_pre_render_styles($elements) {
34723472
$import_batch = array_slice($import, 0, 31);
34733473
$import = array_slice($import, 31);
34743474
$element = $style_element_defaults;
3475-
$element['#value'] = implode("\n", $import_batch);
3475+
// This simplifies the JavaScript regex, allowing each line
3476+
// (separated by \n) to be treated as a completely different string.
3477+
// This means that we can use ^ and $ on one line at a time, and not
3478+
// worry about style tags since they'll never match the regex.
3479+
$element['#value'] = "\n" . implode("\n", $import_batch) . "\n";
34763480
$element['#attributes']['media'] = $group['media'];
34773481
$element['#browsers'] = $group['browsers'];
34783482
$elements[] = $element;
@@ -3798,7 +3802,7 @@ function _drupal_load_stylesheet($matches) {
37983802
// Alter all internal url() paths. Leave external paths alone. We don't need
37993803
// to normalize absolute paths here (i.e. remove folder/... segments) because
38003804
// that will be done later.
3801-
return preg_replace('/url\(\s*([\'"]?)(?![a-z]+:|\/+)/i', 'url(\1'. $directory, $file);
3805+
return preg_replace('/url\(\s*([\'"]?)(?![a-z]+:|\/+)([^\'")]+)([\'"]?)\s*\)/i', 'url(\1' . $directory . '\2\3)', $file);
38023806
}
38033807

38043808
/**
@@ -5285,8 +5289,6 @@ function drupal_cron_run() {
52855289
foreach ($queues as $queue_name => $info) {
52865290
DrupalQueue::get($queue_name)->createQueue();
52875291
}
5288-
// Register shutdown callback.
5289-
drupal_register_shutdown_function('drupal_cron_cleanup');
52905292

52915293
// Iterate through the modules calling their cron handlers (if any):
52925294
foreach (module_implements('cron') as $module) {
@@ -5338,10 +5340,13 @@ function drupal_cron_run() {
53385340
}
53395341

53405342
/**
5341-
* Shutdown function: Performs cron cleanup.
5343+
* DEPRECATED: Shutdown function: Performs cron cleanup.
53425344
*
5343-
* @see drupal_cron_run()
5344-
* @see drupal_register_shutdown_function()
5345+
* This function is deprecated because the 'cron_semaphore' variable it
5346+
* references no longer exists. It is therefore no longer used as a shutdown
5347+
* function by Drupal core.
5348+
*
5349+
* @deprecated
53455350
*/
53465351
function drupal_cron_cleanup() {
53475352
// See if the semaphore is still locked.

includes/file.inc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,7 @@ function file_munge_filename($filename, $extensions, $alerts = TRUE) {
11521152
// Remove any null bytes. See http://php.net/manual/security.filesystem.nullbytes.php
11531153
$filename = str_replace(chr(0), '', $filename);
11541154

1155-
$whitelist = array_unique(explode(' ', trim($extensions)));
1155+
$whitelist = array_unique(explode(' ', strtolower(trim($extensions))));
11561156

11571157
// Split the filename up by periods. The first part becomes the basename
11581158
// the last part the final extension.
@@ -1165,7 +1165,7 @@ function file_munge_filename($filename, $extensions, $alerts = TRUE) {
11651165
// of allowed extensions.
11661166
foreach ($filename_parts as $filename_part) {
11671167
$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)) {
11691169
$new_filename .= '_';
11701170
}
11711171
}

includes/file.mimetypes.inc

+20
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ function file_default_mimetype_mapping() {
4343
4 => 'application/cap',
4444
5 => 'application/cu-seeme',
4545
6 => 'application/dsptype',
46+
350 => 'application/epub+zip',
4647
7 => 'application/hta',
4748
8 => 'application/java-archive',
4849
9 => 'application/java-serialized-object',
@@ -64,6 +65,7 @@ function file_default_mimetype_mapping() {
6465
25 => 'application/rss+xml',
6566
26 => 'application/rtf',
6667
27 => 'application/smil',
68+
349 => 'application/vnd.amazon.ebook',
6769
28 => 'application/vnd.cinderella',
6870
29 => 'application/vnd.google-earth.kml+xml',
6971
30 => 'application/vnd.google-earth.kmz',
@@ -183,6 +185,8 @@ function file_default_mimetype_mapping() {
183185
144 => 'application/x-lzx',
184186
145 => 'application/x-maker',
185187
146 => 'application/x-mif',
188+
351 => 'application/x-mobipocket-ebook',
189+
352 => 'application/x-mobipocket-ebook',
186190
147 => 'application/x-ms-wmd',
187191
148 => 'application/x-ms-wmz',
188192
149 => 'application/x-msdos-program',
@@ -228,8 +232,10 @@ function file_default_mimetype_mapping() {
228232
188 => 'audio/mpeg',
229233
189 => 'audio/ogg',
230234
190 => 'audio/prs.sid',
235+
356 => 'audio/webm',
231236
191 => 'audio/x-aiff',
232237
192 => 'audio/x-gsm',
238+
354 => 'audio/x-matroska',
233239
193 => 'audio/x-mpegurl',
234240
194 => 'audio/x-ms-wax',
235241
195 => 'audio/x-ms-wma',
@@ -301,6 +307,7 @@ function file_default_mimetype_mapping() {
301307
261 => 'image/vnd.djvu',
302308
262 => 'image/vnd.microsoft.icon',
303309
263 => 'image/vnd.wap.wbmp',
310+
355 => 'image/webp',
304311
264 => 'image/x-cmu-raster',
305312
265 => 'image/x-coreldraw',
306313
266 => 'image/x-coreldrawpattern',
@@ -337,6 +344,7 @@ function file_default_mimetype_mapping() {
337344
297 => 'text/vnd.sun.j2me.app-descriptor',
338345
298 => 'text/vnd.wap.wml',
339346
299 => 'text/vnd.wap.wmlscript',
347+
358 => 'text/vtt',
340348
300 => 'text/x-bibtex',
341349
301 => 'text/x-boo',
342350
302 => 'text/x-c++hdr',
@@ -371,9 +379,11 @@ function file_default_mimetype_mapping() {
371379
331 => 'video/ogg',
372380
332 => 'video/quicktime',
373381
333 => 'video/vnd.mpegurl',
382+
357 => 'video/webm',
374383
347 => 'video/x-flv',
375384
334 => 'video/x-la-asf',
376385
348 => 'video/x-m4v',
386+
353 => 'video/x-matroska',
377387
335 => 'video/x-mng',
378388
336 => 'video/x-ms-asf',
379389
337 => 'video/x-ms-wm',
@@ -854,6 +864,16 @@ function file_default_mimetype_mapping() {
854864
'f4b' => 346,
855865
'flv' => 347,
856866
'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,
857877
),
858878
);
859879
}

includes/form.inc

+2
Original file line numberDiff line numberDiff line change
@@ -3311,6 +3311,8 @@ function form_process_container($element, &$form_state) {
33113311
*/
33123312
function theme_container($variables) {
33133313
$element = $variables['element'];
3314+
// Ensure #attributes is set.
3315+
$element += array('#attributes' => array());
33143316

33153317
// Special handling for form elements.
33163318
if (isset($element['#array_parents'])) {

includes/install.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ abstract class DatabaseTasks {
420420
}
421421
}
422422
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;
424424
throw new DatabaseTaskException($message);
425425
}
426426
}

includes/locale.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ function locale_language_switcher_session($type, $path) {
398398
$links[$langcode]['query'][$param] = $langcode;
399399
}
400400
else {
401-
$links[$langcode]['attributes']['class'][] = ' session-active';
401+
$links[$langcode]['attributes']['class'][] = 'session-active';
402402
}
403403
}
404404

includes/mail.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* $conf['mail_line_endings'] will override this setting.
1212
*/
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");
1414

1515
/**
1616
* Composes and optionally sends an e-mail message.

includes/menu.inc

+1
Original file line numberDiff line numberDiff line change
@@ -2495,6 +2495,7 @@ function menu_link_get_preferred($path = NULL, $selected_menu = NULL) {
24952495
$query->addField('ml', 'weight', 'link_weight');
24962496
$query->fields('m');
24972497
$query->condition('ml.link_path', $path_candidates, 'IN');
2498+
$query->addTag('preferred_menu_links');
24982499

24992500
// Sort candidates by link path and menu name.
25002501
$candidates = array();

includes/theme.inc

+4-4
Original file line numberDiff line numberDiff line change
@@ -1554,7 +1554,7 @@ function _theme_render_template_debug($template_function, $template_file, $varia
15541554
'debug_suffix' => '',
15551555
);
15561556
$output['debug_prefix'] .= "\n\n<!-- THEME DEBUG -->";
1557-
$output['debug_prefix'] .= "\n<!-- CALL: theme('{$variables['theme_hook_original']}') -->";
1557+
$output['debug_prefix'] .= "\n<!-- CALL: theme('" . check_plain($variables['theme_hook_original']) . "') -->";
15581558
// If there are theme suggestions, reverse the array so more specific
15591559
// suggestions are shown first.
15601560
if (!empty($variables['theme_hook_suggestions'])) {
@@ -1587,10 +1587,10 @@ function _theme_render_template_debug($template_function, $template_file, $varia
15871587
$prefix = ($template == $current_template) ? 'x' : '*';
15881588
$suggestion = $prefix . ' ' . $template;
15891589
}
1590-
$output['debug_info'] .= "\n<!-- FILE NAME SUGGESTIONS:\n " . implode("\n ", $suggestions) . "\n-->";
1590+
$output['debug_info'] .= "\n<!-- FILE NAME SUGGESTIONS:\n " . check_plain(implode("\n ", $suggestions)) . "\n-->";
15911591
}
1592-
$output['debug_info'] .= "\n<!-- BEGIN OUTPUT from '{$template_file}' -->\n";
1593-
$output['debug_suffix'] .= "\n<!-- END OUTPUT from '{$template_file}' -->\n\n";
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";
15941594
return implode('', $output);
15951595
}
15961596

0 commit comments

Comments
 (0)