updated drupal core to 7.51
This commit is contained in:
@@ -760,7 +760,8 @@ function drupal_access_denied() {
|
||||
* - headers: An array containing request headers to send as name/value pairs.
|
||||
* - method: A string containing the request method. Defaults to 'GET'.
|
||||
* - data: A string containing the request body, formatted as
|
||||
* 'param=value¶m=value&...'. Defaults to NULL.
|
||||
* 'param=value¶m=value&...'; to generate this, use http_build_query().
|
||||
* Defaults to NULL.
|
||||
* - max_redirects: An integer representing how many times a redirect
|
||||
* may be followed. Defaults to 3.
|
||||
* - timeout: A float representing the maximum number of seconds the function
|
||||
@@ -785,6 +786,8 @@ function drupal_access_denied() {
|
||||
* HTTP header names are case-insensitive (RFC 2616, section 4.2), so for
|
||||
* easy access the array keys are returned in lower case.
|
||||
* - data: A string containing the response body that was received.
|
||||
*
|
||||
* @see http_build_query()
|
||||
*/
|
||||
function drupal_http_request($url, array $options = array()) {
|
||||
// Allow an alternate HTTP client library to replace Drupal's default
|
||||
@@ -1767,9 +1770,15 @@ function format_rss_item($title, $link, $description, $args = array()) {
|
||||
* - 'key': element name
|
||||
* - 'value': element contents
|
||||
* - 'attributes': associative array of element attributes
|
||||
* - 'encoded': TRUE if 'value' is already encoded
|
||||
*
|
||||
* In both cases, 'value' can be a simple string, or it can be another array
|
||||
* with the same format as $array itself for nesting.
|
||||
*
|
||||
* If 'encoded' is TRUE it is up to the caller to ensure that 'value' is either
|
||||
* entity-encoded or CDATA-escaped. Using this option is not recommended when
|
||||
* working with untrusted user input, since failing to escape the data
|
||||
* correctly has security implications.
|
||||
*/
|
||||
function format_xml_elements($array) {
|
||||
$output = '';
|
||||
@@ -1782,7 +1791,7 @@ function format_xml_elements($array) {
|
||||
}
|
||||
|
||||
if (isset($value['value']) && $value['value'] != '') {
|
||||
$output .= '>' . (is_array($value['value']) ? format_xml_elements($value['value']) : check_plain($value['value'])) . '</' . $value['key'] . ">\n";
|
||||
$output .= '>' . (is_array($value['value']) ? format_xml_elements($value['value']) : (!empty($value['encoded']) ? $value['value'] : check_plain($value['value']))) . '</' . $value['key'] . ">\n";
|
||||
}
|
||||
else {
|
||||
$output .= " />\n";
|
||||
@@ -2644,6 +2653,15 @@ function drupal_deliver_html_page($page_callback_result) {
|
||||
global $language;
|
||||
drupal_add_http_header('Content-Language', $language->language);
|
||||
|
||||
// By default, do not allow the site to be rendered in an iframe on another
|
||||
// domain, but provide a variable to override this. If the code running for
|
||||
// this page request already set the X-Frame-Options header earlier, don't
|
||||
// overwrite it here.
|
||||
$frame_options = variable_get('x_frame_options', 'SAMEORIGIN');
|
||||
if ($frame_options && is_null(drupal_get_http_header('X-Frame-Options'))) {
|
||||
drupal_add_http_header('X-Frame-Options', $frame_options);
|
||||
}
|
||||
|
||||
// Menu status constants are integers; page content is a string or array.
|
||||
if (is_int($page_callback_result)) {
|
||||
// @todo: Break these up into separate functions?
|
||||
@@ -2758,6 +2776,7 @@ function drupal_page_footer() {
|
||||
_registry_check_code(REGISTRY_WRITE_LOOKUP_CACHE);
|
||||
drupal_cache_system_paths();
|
||||
module_implements_write_cache();
|
||||
drupal_file_scan_write_cache();
|
||||
system_run_automated_cron();
|
||||
}
|
||||
|
||||
@@ -3025,6 +3044,13 @@ function drupal_add_html_head_link($attributes, $header = FALSE) {
|
||||
*/
|
||||
function drupal_add_css($data = NULL, $options = NULL) {
|
||||
$css = &drupal_static(__FUNCTION__, array());
|
||||
$count = &drupal_static(__FUNCTION__ . '_count', 0);
|
||||
|
||||
// If the $css variable has been reset with drupal_static_reset(), there is
|
||||
// no longer any CSS being tracked, so set the counter back to 0 also.
|
||||
if (count($css) === 0) {
|
||||
$count = 0;
|
||||
}
|
||||
|
||||
// Construct the options, taking the defaults into consideration.
|
||||
if (isset($options)) {
|
||||
@@ -3060,7 +3086,8 @@ function drupal_add_css($data = NULL, $options = NULL) {
|
||||
}
|
||||
|
||||
// Always add a tiny value to the weight, to conserve the insertion order.
|
||||
$options['weight'] += count($css) / 1000;
|
||||
$options['weight'] += $count / 1000;
|
||||
$count++;
|
||||
|
||||
// Add the data to the CSS array depending on the type.
|
||||
switch ($options['type']) {
|
||||
@@ -3873,6 +3900,21 @@ function drupal_delete_file_if_stale($uri) {
|
||||
* The cleaned identifier.
|
||||
*/
|
||||
function drupal_clean_css_identifier($identifier, $filter = array(' ' => '-', '_' => '-', '/' => '-', '[' => '-', ']' => '')) {
|
||||
// Use the advanced drupal_static() pattern, since this is called very often.
|
||||
static $drupal_static_fast;
|
||||
if (!isset($drupal_static_fast)) {
|
||||
$drupal_static_fast['allow_css_double_underscores'] = &drupal_static(__FUNCTION__ . ':allow_css_double_underscores');
|
||||
}
|
||||
$allow_css_double_underscores = &$drupal_static_fast['allow_css_double_underscores'];
|
||||
if (!isset($allow_css_double_underscores)) {
|
||||
$allow_css_double_underscores = variable_get('allow_css_double_underscores', FALSE);
|
||||
}
|
||||
|
||||
// Preserve BEM-style double-underscores depending on custom setting.
|
||||
if ($allow_css_double_underscores) {
|
||||
$filter['__'] = '__';
|
||||
}
|
||||
|
||||
// By default, we filter using Drupal's coding standards.
|
||||
$identifier = strtr($identifier, $filter);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user