diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2006-08-24 00:04:44 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2006-08-24 00:04:44 +0000 |
commit | 849a10fbbab9abb2858bd5c2e080f926adb063db (patch) | |
tree | fc1fe511636108daed48c4e0b82759c79a0f61df | |
parent | 158a8814ebe80fcd138c83225742d7255f74c0a9 (diff) | |
download | brdo-849a10fbbab9abb2858bd5c2e080f926adb063db.tar.gz brdo-849a10fbbab9abb2858bd5c2e080f926adb063db.tar.bz2 |
Allow absolute urls for theme('image'), needed for user pictures to work properly.
-rw-r--r-- | includes/theme.inc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/includes/theme.inc b/includes/theme.inc index 124f187d7..69c6957c6 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -534,7 +534,7 @@ function theme_links($links, $delimiter = ' | ') { * Return a themed image. * * @param $path - * The path of the image file. + * Either the path of the image file (relative to base_path()) or a full URL. * @param $alt * The alternative text for text-based browsers. * @param $title @@ -549,7 +549,8 @@ function theme_links($links, $delimiter = ' | ') { function theme_image($path, $alt = '', $title = '', $attributes = NULL, $getsize = TRUE) { if (!$getsize || (is_file($path) && (list($width, $height, $type, $image_attributes) = @getimagesize($path)))) { $attributes = drupal_attributes($attributes); - return '<img src="'. check_url(base_path() . $path) .'" alt="'. check_plain($alt) .'" title="'. check_plain($title) .'" '. $image_attributes . $attributes .' />'; + $url = (url($path) == $path) ? $path : (base_path() . $path); + return '<img src="'. check_url($url) .'" alt="'. check_plain($alt) .'" title="'. check_plain($title) .'" '. $image_attributes . $attributes .' />'; } } |