Skip to content

Commit 02ce220

Browse files
committed
Backdrop 1.28.1
1 parent e4a3503 commit 02ce220

File tree

245 files changed

+1369
-907
lines changed

Some content is hidden

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

245 files changed

+1369
-907
lines changed

docroot/core/includes/bootstrap.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/**
88
* The current system version.
99
*/
10-
define('BACKDROP_VERSION', '1.28.0');
10+
define('BACKDROP_VERSION', '1.28.1');
1111

1212
/**
1313
* Core API compatibility.

docroot/core/includes/common.inc

+2
Original file line numberDiff line numberDiff line change
@@ -953,6 +953,8 @@ function backdrop_access_denied() {
953953
* @see backdrop_http_build_query()
954954
*
955955
* @since 1.18.4 The $options['data'] key may now be passed as an array.
956+
* @since 1.27.2 Support added for the 429 response code (previously treaded as
957+
* a 400).
956958
* @since 1.27.2 Now removes any potentially sensitive headers before following
957959
* a redirect. See the 'strip_sensitive_headers_on_host_change' setting in
958960
* settings.php for details.

docroot/core/includes/icon.inc

+32-6
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ function icon_get_info($icon_name = NULL) {
269269
* Returns HTML for an inline-icon.
270270
*
271271
* This effectively returns the contents of an SVG file. But it could
272-
* potentially be override to replace inlined SVGs with other mechanisms, like
272+
* potentially be overridden to replace inlined SVGs with other mechanisms, like
273273
* an icon font.
274274
*
275275
* @param array $variables
@@ -282,20 +282,46 @@ function icon_get_info($icon_name = NULL) {
282282
* - attributes: Attributes to be added to the icon itself.
283283
*
284284
* @return string
285-
* The HTML output.
285+
* The HTML output.
286286
*
287287
* @since 1.28.0 Function added.
288+
* @since 1.28.1 The <ellipse>, <line>, <polygon> and <polyline> SVG elements
289+
* are allowed.
288290
*/
289291
function theme_icon(array $variables) {
290292
// Ensure the filename is .svg.
291293
if (image_is_svg($variables['path'])) {
292294
// Ensure the file contents are an SVG.
293295
$svg_contents = file_get_contents($variables['path']);
294296
if (strpos($svg_contents, '<svg') === 0) {
295-
// Clean out any embedded XSS within the SVG. This very-restrictive set
296-
// of options should be adequate for icons.
297-
$svg_contents = filter_xss($svg_contents, array('svg', 'use', 'title',
298-
'desc', 'defs', 'linearGradient', 'stop', 'rect', 'circle', 'path'));
297+
// Allow basic shapes. See:
298+
// https://developer.mozilla.org/en-US/docs/Web/SVG/Element#basic_shapes.
299+
$allowed_svg_basic_shapes = array(
300+
'circle',
301+
'ellipse',
302+
'line',
303+
'polygon',
304+
'polyline',
305+
'rect',
306+
);
307+
308+
// Allow some other elements. This very-restrictive set of options should
309+
// be adequate for icons.
310+
$allowed_svg_other = array(
311+
'defs',
312+
'desc',
313+
'linearGradient',
314+
'path',
315+
'stop',
316+
'svg',
317+
'title',
318+
'use',
319+
);
320+
321+
$allowed_svg_elements = array_merge($allowed_svg_basic_shapes, $allowed_svg_other);
322+
323+
// Clean out any embedded XSS within the SVG.
324+
$svg_contents = filter_xss($svg_contents, $allowed_svg_elements);
299325

300326
// Move the "alt" text to an attribute.
301327
if ($variables['alt']) {

docroot/core/includes/image.inc

+9-6
Original file line numberDiff line numberDiff line change
@@ -584,18 +584,21 @@ function image_is_svg($uri) {
584584
function image_add_svg_attributes($svg_content, array $attributes) {
585585
$doc = new DOMDocument();
586586
$doc->loadXML($svg_content);
587+
$svg_tag = $doc->getElementsByTagName('svg')->item(0);
587588

588589
// Convert the alt attribute to a <title> element.
589590
if (isset($attributes['alt'])) {
590591
try {
591592
if (strlen($attributes['alt'])) {
592593
$title = $doc->createElement('title');
593594
$title->textContent = $attributes['alt'];
594-
$doc->firstChild->prepend($title);
595+
// Since DOMDocument::prepend() is not available in PHP versions prior
596+
// to v8, we are using DOMNode::insertBefore().
597+
$svg_tag->insertBefore($title, $svg_tag->firstChild);
595598
}
596599
// Remove any given <title> element if alt is an empty string.
597-
elseif ($doc->firstChild->firstChild && $doc->firstChild->firstChild->nodeName === 'title') {
598-
$doc->firstChild->removeChild($doc->firstChild->firstChild);
600+
elseif ($svg_tag->firstChild && $svg_tag->firstChild->nodeName === 'title') {
601+
$svg_tag->removeChild($svg_tag->firstChild);
599602
}
600603
} catch (DOMException $e) {}
601604
unset($attributes['alt']);
@@ -604,13 +607,13 @@ function image_add_svg_attributes($svg_content, array $attributes) {
604607
foreach ($attributes as $attribute_name => $attribute_value) {
605608
$attribute_value = implode(' ', (array) $attribute_value);
606609
if (strlen($attribute_value)) {
607-
$doc->firstChild->setAttribute($attribute_name, $attribute_value);
610+
$svg_tag->setAttribute($attribute_name, $attribute_value);
608611
}
609612
else {
610-
$doc->firstChild->removeAttribute($attribute_name);
613+
$svg_tag->removeAttribute($attribute_name);
611614
}
612615
}
613-
return $doc->saveXML($doc->firstChild);
616+
return $doc->saveXML($svg_tag);
614617
}
615618

616619
/**

docroot/core/includes/menu.inc

+6-3
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,11 @@ define('MENU_CALLBACK', 0x0000);
154154
*
155155
* Modules may "suggest" menu items that the administrator may enable. They act
156156
* just as callbacks do until enabled, at which time they act like normal items.
157-
* Note for the value: 0x0010 was a flag which is no longer used, but this way
158-
* the values of MENU_CALLBACK and MENU_SUGGESTED_ITEM are separate.
157+
*
158+
* Note: The value 0x0010 cannot be removed from the definition of
159+
* MENU_SUGGESTED_ITEM. It is a flag (no longer used) that at one time ensured
160+
* that the values of MENU_VISIBLE_IN_BREADCRUMB and MENU_SUGGESTED_ITEM were
161+
* separate.
159162
*/
160163
define('MENU_SUGGESTED_ITEM', MENU_VISIBLE_IN_BREADCRUMB | 0x0010);
161164

@@ -730,7 +733,7 @@ function _menu_item_localize(&$item, $map, $link_translate = FALSE) {
730733
$item['localized_options'] = $item['options'];
731734
// All 'class' attributes are assumed to be an array during rendering, but
732735
// links stored in the database may use an old string value.
733-
// @todo In order to remove this code we need to implement a database update
736+
// @todo In order to remove this code we need to implement a site update,
734737
// including unserializing all existing link options and running this code
735738
// on them, as well as adding validation to menu_link_save().
736739
if (isset($item['options']['attributes']['class']) && is_string($item['options']['attributes']['class'])) {

docroot/core/includes/update.inc

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22
/**
33
* @file
4-
* Backdrop database update API.
4+
* Backdrop site update API.
55
*
6-
* This file contains functions to perform database updates for a Backdrop
7-
* installation. It is included and used extensively by update.php.
6+
* This file contains functions to perform database and config updates for a
7+
* Backdrop installation. It is included and used extensively by update.php.
88
*/
99

1010
/**
@@ -611,7 +611,7 @@ function update_do_one($module, $number, $dependency_map, &$context) {
611611
class BackdropUpdateException extends Exception { }
612612

613613
/**
614-
* Starts the database update batch process.
614+
* Starts the site update batch process.
615615
*
616616
* @param $start
617617
* An array whose keys contain the names of modules to be updated during the
@@ -714,11 +714,11 @@ function update_finished($success, $results, $operations) {
714714
}
715715

716716
/**
717-
* Returns a list of all the pending database updates.
717+
* Returns a list of all the pending site updates.
718718
*
719719
* @return
720-
* An associative array keyed by module name which contains all information
721-
* about database updates that need to be run, and any updates that are not
720+
* An associative array keyed by module name, which contains all information
721+
* about site updates that need to be run and any updates that are not
722722
* going to proceed due to missing requirements. The system module will
723723
* always be listed first.
724724
*

docroot/core/layouts/boxton/boxton.info

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ preview = boxton.png
2525
; Include the Bootstrap4 Grid System
2626
libraries[] = bootstrap4-gs
2727

28-
; Added by Backdrop CMS packaging script on 2024-05-15
28+
; Added by Backdrop CMS packaging script on 2024-06-23
2929
project = backdrop
30-
version = 1.28.0
31-
timestamp = 1715827451
30+
version = 1.28.1
31+
timestamp = 1719196650

docroot/core/layouts/geary/geary.info

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ preview = geary.png
2727
; Include the Bootstrap4 Grid System
2828
libraries[] = bootstrap4-gs
2929

30-
; Added by Backdrop CMS packaging script on 2024-05-15
30+
; Added by Backdrop CMS packaging script on 2024-06-23
3131
project = backdrop
32-
version = 1.28.0
33-
timestamp = 1715827451
32+
version = 1.28.1
33+
timestamp = 1719196650

docroot/core/layouts/harris/harris.info

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ preview = harris.png
2727
; Include the Bootstrap4 Grid System
2828
libraries[] = bootstrap4-gs
2929

30-
; Added by Backdrop CMS packaging script on 2024-05-15
30+
; Added by Backdrop CMS packaging script on 2024-06-23
3131
project = backdrop
32-
version = 1.28.0
33-
timestamp = 1715827451
32+
version = 1.28.1
33+
timestamp = 1719196650

docroot/core/layouts/legacy/one_column/one_column.info

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ regions[footer] = Footer
1818
; Modify this line if you would like to change the default in this layout.
1919
default region = content
2020

21-
; Added by Backdrop CMS packaging script on 2024-05-15
21+
; Added by Backdrop CMS packaging script on 2024-06-23
2222
project = backdrop
23-
version = 1.28.0
24-
timestamp = 1715827451
23+
version = 1.28.1
24+
timestamp = 1719196650

docroot/core/layouts/legacy/three_three_four_column/three_three_four_column.info

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ regions[footer] = Footer bottom
2626
; Modify this line if you would like to change the default in this layout.
2727
default region = content
2828

29-
; Added by Backdrop CMS packaging script on 2024-05-15
29+
; Added by Backdrop CMS packaging script on 2024-06-23
3030
project = backdrop
31-
version = 1.28.0
32-
timestamp = 1715827451
31+
version = 1.28.1
32+
timestamp = 1719196650

docroot/core/layouts/legacy/two_column/two_column.info

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ regions[footer] = Footer
1515
; Modify this line if you would like to change the default in this layout.
1616
default region = content
1717

18-
; Added by Backdrop CMS packaging script on 2024-05-15
18+
; Added by Backdrop CMS packaging script on 2024-06-23
1919
project = backdrop
20-
version = 1.28.0
21-
timestamp = 1715827451
20+
version = 1.28.1
21+
timestamp = 1719196650

docroot/core/layouts/legacy/two_column_flipped/two_column_flipped.info

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ regions[footer] = Footer
1515
; Modify this line if you would like to change the default in this layout.
1616
default region = content
1717

18-
; Added by Backdrop CMS packaging script on 2024-05-15
18+
; Added by Backdrop CMS packaging script on 2024-06-23
1919
project = backdrop
20-
version = 1.28.0
21-
timestamp = 1715827451
20+
version = 1.28.1
21+
timestamp = 1719196650

docroot/core/layouts/moscone/moscone.info

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ preview = moscone.png
2626
; Include the Bootstrap4 Grid System
2727
libraries[] = bootstrap4-gs
2828

29-
; Added by Backdrop CMS packaging script on 2024-05-15
29+
; Added by Backdrop CMS packaging script on 2024-06-23
3030
project = backdrop
31-
version = 1.28.0
32-
timestamp = 1715827451
31+
version = 1.28.1
32+
timestamp = 1719196650

docroot/core/layouts/moscone_flipped/moscone_flipped.info

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ preview = moscone-flipped.png
2626
; Include the Bootstrap4 Grid System
2727
libraries[] = bootstrap4-gs
2828

29-
; Added by Backdrop CMS packaging script on 2024-05-15
29+
; Added by Backdrop CMS packaging script on 2024-06-23
3030
project = backdrop
31-
version = 1.28.0
32-
timestamp = 1715827451
31+
version = 1.28.1
32+
timestamp = 1719196650

docroot/core/layouts/rolph/rolph.info

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ preview = rolph.png
2828
; Include the Bootstrap4 Grid System
2929
libraries[] = bootstrap4-gs
3030

31-
; Added by Backdrop CMS packaging script on 2024-05-15
31+
; Added by Backdrop CMS packaging script on 2024-06-23
3232
project = backdrop
33-
version = 1.28.0
34-
timestamp = 1715827451
33+
version = 1.28.1
34+
timestamp = 1719196650

docroot/core/layouts/simmons/simmons.info

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ file = simmons.php
3434
; Default stylesheets for this layout
3535
; stylesheets[all][] = simmons.css
3636

37-
; Added by Backdrop CMS packaging script on 2024-05-15
37+
; Added by Backdrop CMS packaging script on 2024-06-23
3838
project = backdrop
39-
version = 1.28.0
40-
timestamp = 1715827451
39+
version = 1.28.1
40+
timestamp = 1719196650

docroot/core/layouts/sutro/sutro.info

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ preview = sutro.png
2727
; Include the Bootstrap4 Grid System
2828
libraries[] = bootstrap4-gs
2929

30-
; Added by Backdrop CMS packaging script on 2024-05-15
30+
; Added by Backdrop CMS packaging script on 2024-06-23
3131
project = backdrop
32-
version = 1.28.0
33-
timestamp = 1715827451
32+
version = 1.28.1
33+
timestamp = 1719196650

docroot/core/layouts/taylor/taylor.info

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ preview = taylor.png
2727
; Include the Bootstrap4 Grid System
2828
libraries[] = bootstrap4-gs
2929

30-
; Added by Backdrop CMS packaging script on 2024-05-15
30+
; Added by Backdrop CMS packaging script on 2024-06-23
3131
project = backdrop
32-
version = 1.28.0
33-
timestamp = 1715827451
32+
version = 1.28.1
33+
timestamp = 1719196650

docroot/core/layouts/taylor_flipped/taylor_flipped.info

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ preview = taylor-flipped.png
2727
; Include the Bootstrap4 Grid System
2828
libraries[] = bootstrap4-gs
2929

30-
; Added by Backdrop CMS packaging script on 2024-05-15
30+
; Added by Backdrop CMS packaging script on 2024-06-23
3131
project = backdrop
32-
version = 1.28.0
33-
timestamp = 1715827451
32+
version = 1.28.1
33+
timestamp = 1719196650

docroot/core/misc/ajax.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ Backdrop.ajax = function (base, element, element_settings) {
218218
// Sanity check for browser support (object expected).
219219
// When using iFrame uploads, responses must be returned as a string.
220220
if (typeof response == 'string') {
221-
response = $.parseJSON(response);
221+
response = JSON.parse(response);
222222

223223
// Prior to invoking the response's commands, verify that they can be
224224
// trusted by checking for a response header. See

docroot/core/misc/backdrop.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -586,15 +586,15 @@ Backdrop.ajaxError = function (xmlhttp, uri, customMessage) {
586586
// Unfortunately, testing for it with typeof, etc, doesn't seem to catch that
587587
// and the test causes an exception. So we need to catch the exception here.
588588
try {
589-
statusText = "\n" + Backdrop.t("StatusText: !statusText", {'!statusText': $.trim(xmlhttp.statusText)});
589+
statusText = "\n" + Backdrop.t("StatusText: !statusText", {'!statusText': xmlhttp.statusText.trim()});
590590
}
591591
catch (e) {}
592592

593593
responseText = '';
594594
// Again, we don't have a way to know for sure whether accessing
595595
// xmlhttp.responseText is going to throw an exception. So we'll catch it.
596596
try {
597-
responseText = "\n" + Backdrop.t("ResponseText: !responseText", {'!responseText': $.trim(xmlhttp.responseText) } );
597+
responseText = "\n" + Backdrop.t("ResponseText: !responseText", {'!responseText': xmlhttp.responseText.trim() } );
598598
} catch (e) {}
599599

600600
// Make the responseText more readable by stripping HTML tags and newlines.

0 commit comments

Comments
 (0)