updated core to 7.53
This commit is contained in:
@@ -64,7 +64,7 @@ function image_help($path, $arg) {
|
||||
$effect = image_effect_definition_load($arg[7]);
|
||||
return isset($effect['help']) ? ('<p>' . $effect['help'] . '</p>') : NULL;
|
||||
case 'admin/config/media/image-styles/edit/%/effects/%':
|
||||
$effect = ($arg[5] == 'add') ? image_effect_definition_load($arg[6]) : image_effect_load($arg[6], $arg[4]);
|
||||
$effect = ($arg[5] == 'add') ? image_effect_definition_load($arg[6]) : image_effect_load($arg[7], $arg[5]);
|
||||
return isset($effect['help']) ? ('<p>' . $effect['help'] . '</p>') : NULL;
|
||||
}
|
||||
}
|
||||
@@ -801,6 +801,8 @@ function image_style_options($include_empty = TRUE, $output = CHECK_PLAIN) {
|
||||
*
|
||||
* @param $style
|
||||
* The image style
|
||||
* @param $scheme
|
||||
* The file scheme, for example 'public' for public files.
|
||||
*/
|
||||
function image_style_deliver($style, $scheme) {
|
||||
$args = func_get_args();
|
||||
@@ -833,8 +835,8 @@ function image_style_deliver($style, $scheme) {
|
||||
file_download($scheme, file_uri_target($derivative_uri));
|
||||
}
|
||||
else {
|
||||
$headers = module_invoke_all('file_download', $image_uri);
|
||||
if (in_array(-1, $headers) || empty($headers)) {
|
||||
$headers = file_download_headers($image_uri);
|
||||
if (empty($headers)) {
|
||||
return MENU_ACCESS_DENIED;
|
||||
}
|
||||
if (count($headers)) {
|
||||
@@ -1027,7 +1029,15 @@ function image_style_url($style_name, $path) {
|
||||
// The token query is added even if the 'image_allow_insecure_derivatives'
|
||||
// variable is TRUE, so that the emitted links remain valid if it is changed
|
||||
// back to the default FALSE.
|
||||
$token_query = array(IMAGE_DERIVATIVE_TOKEN => image_style_path_token($style_name, $original_uri));
|
||||
// However, sites which need to prevent the token query from being emitted at
|
||||
// all can additionally set the 'image_suppress_itok_output' variable to TRUE
|
||||
// to achieve that (if both are set, the security token will neither be
|
||||
// emitted in the image derivative URL nor checked for in
|
||||
// image_style_deliver()).
|
||||
$token_query = array();
|
||||
if (!variable_get('image_suppress_itok_output', FALSE)) {
|
||||
$token_query = array(IMAGE_DERIVATIVE_TOKEN => image_style_path_token($style_name, $original_uri));
|
||||
}
|
||||
|
||||
// If not using clean URLs, the image derivative callback is only available
|
||||
// with the query string. If the file does not exist, use url() to ensure
|
||||
@@ -1039,8 +1049,12 @@ function image_style_url($style_name, $path) {
|
||||
}
|
||||
|
||||
$file_url = file_create_url($uri);
|
||||
// Append the query string with the token.
|
||||
return $file_url . (strpos($file_url, '?') !== FALSE ? '&' : '?') . drupal_http_build_query($token_query);
|
||||
// Append the query string with the token, if necessary.
|
||||
if ($token_query) {
|
||||
$file_url .= (strpos($file_url, '?') !== FALSE ? '&' : '?') . drupal_http_build_query($token_query);
|
||||
}
|
||||
|
||||
return $file_url;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user