diff options
Diffstat (limited to 'modules/image')
-rw-r--r-- | modules/image/image.module | 15 | ||||
-rw-r--r-- | modules/image/image.test | 16 |
2 files changed, 19 insertions, 12 deletions
diff --git a/modules/image/image.module b/modules/image/image.module index 394bd5df5..a93dda997 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 ec8525518..d8426e70d 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', ); } |