### Eclipse Workspace Patch 1.0 #P visitdk Index: modules/image/image.module =================================================================== --- modules/image/image.module (revision 6273) +++ modules/image/image.module (working copy) @@ -973,10 +973,11 @@ */ function image_style_url($style_name, $path) { $uri = image_style_path($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, file_stream_wrapper_uri_normalize($path))); + $token_query = array(IMAGE_DERIVATIVE_TOKEN => image_style_path_token($style_name, image_style_path_normalize($path))); // 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 @@ -1040,6 +1041,26 @@ } /** + * Add schema to the $uri parameter if no schema in the path. + * @param string + * $path + * @return string + * $uri + */ +function image_style_path_normalize($uri) { + $scheme = file_uri_scheme($uri); + if (!$scheme) { + $scheme = file_default_scheme(); + $uri = $scheme . '://' . $uri; + } + else { + $uri = file_stream_wrapper_uri_normalize($uri); + } + + return $uri; +} + +/** * Save a default image style to the database. * * @param style