--- /Users/cmessina/Sites/civicspace-svn/themes/civicspace/template.php	2005-06-28 18:02:42.000000000 -0700
+++ /Users/cmessina/Sites/civicspace-edit/themes/civicspace/template.php	2005-06-28 14:40:34.000000000 -0700
@@ -811,21 +811,22 @@ function phptemplate_filter_tips($tips, 
 }
 
 /* changed sort images */
-function phptemplate_image($path, $alt = '', $title = '', $attributes = array(), $getsize = TRUE) {
+function phptemplate_image($path, $alt = '', $title = '', $attributes = NULL, $getsize = TRUE) {
   switch ($path) {
-    case 'misc/arrow-asc.png':
-      $path = path_to_theme() . '/images/asc.png';
-      break;
-    case 'misc/arrow-desc.png':
-      $path = path_to_theme() . '/images/desc.png';
-      break;
-    }
-    if (!$getsize || (file_exists($path) && (list($width, $height, $type, $image_attributes) = @getimagesize($path)))) {
-      $attributes = drupal_attributes($attributes);
-      return "<img src=\"$path\" $image_attributes $attributes alt=\"$alt\" title=\"$title\" />";
-    }
+  case 'misc/arrow-asc.png':
+    $path = path_to_theme() . '/images/asc.png';
+    break;
+  case 'misc/arrow-desc.png':
+    $path = path_to_theme() . '/images/desc.png';
+    break;
+  }
+  if (!$getsize || (is_file($path) && (list($width, $height, $type, $image_attributes) = @getimagesize($path)))) {
+    $attributes = drupal_attributes($attributes);
+    return '<img src="'. check_url($path) .'" alt="'. check_plain($alt) .'" title="'. check_plain($title) .'" '. $image_attributes . $attributes .' />';
+  }
 } 
 
+
 /**
  * =Books
  */
