drupal core updated to 7.28
This commit is contained in:
@@ -835,7 +835,7 @@ function image_style_deliver($style, $scheme) {
|
||||
else {
|
||||
$headers = module_invoke_all('file_download', $image_uri);
|
||||
if (in_array(-1, $headers) || empty($headers)) {
|
||||
return drupal_access_denied();
|
||||
return MENU_ACCESS_DENIED;
|
||||
}
|
||||
if (count($headers)) {
|
||||
foreach ($headers as $name => $value) {
|
||||
@@ -972,7 +972,9 @@ function image_style_flush($style) {
|
||||
// Delete the style directory in each registered wrapper.
|
||||
$wrappers = file_get_stream_wrappers(STREAM_WRAPPERS_WRITE_VISIBLE);
|
||||
foreach ($wrappers as $wrapper => $wrapper_data) {
|
||||
file_unmanaged_delete_recursive($wrapper . '://styles/' . $style['name']);
|
||||
if (file_exists($directory = $wrapper . '://styles/' . $style['name'])) {
|
||||
file_unmanaged_delete_recursive($directory);
|
||||
}
|
||||
}
|
||||
|
||||
// Let other modules update as necessary on flush.
|
||||
@@ -1010,10 +1012,14 @@ function image_style_flush($style) {
|
||||
*/
|
||||
function image_style_url($style_name, $path) {
|
||||
$uri = image_style_path($style_name, $path);
|
||||
|
||||
// The passed-in $path variable can be either a relative path or a full URI.
|
||||
$original_uri = file_uri_scheme($path) ? file_stream_wrapper_uri_normalize($path) : file_build_uri($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, file_stream_wrapper_uri_normalize($path)));
|
||||
$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
|
||||
|
||||
Reference in New Issue
Block a user