diff --git a/modules/image/image.module b/modules/image/image.module index 394bd5df50501ddbc23fbd4c77ba89a341747b42..a93dda99764f43b4c70aa57737efefc918bada3f 100644 --- a/modules/image/image.module +++ b/modules/image/image.module @@ -29,7 +29,14 @@ function image_menu() { function image_theme() { return array( 'image_style' => array( - 'arguments' => array('style' => NULL, 'path' => NULL, 'alt' => '', 'title' => '', 'attributes' => array(), 'getsize' => TRUE), + 'arguments' => array( + 'style' => NULL, + 'path' => NULL, + 'alt' => '', + 'title' => '', + 'attributes' => array(), + 'getsize' => TRUE, + ), ), ); } @@ -449,11 +456,11 @@ function image_style_generate_url($style_name, $path) { // Disable page cache for this request. This prevents anonymous users from // needlessly hitting the image generation URL when the image already exists. - $GLOBALS['conf']['cache'] = CACHE_DISABLED; + drupal_page_is_cacheable(FALSE); // Set a cache entry to grant access to this style/image path. This will be // checked by image_style_generate(). - cache_set('access:' . $style_name . ':' . md5($path), 1, 'cache_image', time() + 600); + cache_set('access:' . $style_name . ':' . md5($path), 1, 'cache_image', REQUEST_TIME + 600); // Generate a callback path for the image. $url = url('image/generate/' . $style_name . '/' . $path, array('absolute' => TRUE)); @@ -636,7 +643,7 @@ function image_effect_delete($effect) { * @return * TRUE on success. FALSE if unable to perform effect on image. */ -function image_effect_apply(&$image, $effect) { +function image_effect_apply($image, $effect) { if (drupal_function_exists($effect['effect callback'])) { return call_user_func($effect['effect callback'], $image, $effect['data']); } diff --git a/modules/image/image.test b/modules/image/image.test index ec852551847ce8755bc6bacb787a505dd6ad9b47..d8426e70df464f5c3efc9be68bf31d96e4213367 100644 --- a/modules/image/image.test +++ b/modules/image/image.test @@ -35,11 +35,11 @@ class ImageStylesPathAndUrlUnitTest extends DrupalWebTestCase { protected $image_with_generated; protected $image_without_generated; - function getInfo() { + public static function getInfo() { return array( - 'name' => t('Image styles path and URL functions'), - 'description' => t('Tests functions for generating paths and URLs to image styles.'), - 'group' => t('Image') + 'name' => 'Image styles path and URL functions', + 'description' => 'Tests functions for generating paths and URLs to image styles.', + 'group' => 'Image', ); } @@ -108,11 +108,11 @@ class ImageStylesPathAndUrlUnitTest extends DrupalWebTestCase { * properly passing parameters to the image toolkit. */ class ImageEffectsUnitTest extends ImageToolkitTestCase { - function getInfo() { + public static function getInfo() { return array( - 'name' => t('Image effects'), - 'description' => t('Test that the image effects pass parameters to the toolkit correctly.'), - 'group' => t('Image') + 'name' => 'Image effects', + 'description' => 'Test that the image effects pass parameters to the toolkit correctly.', + 'group' => 'Image', ); }