Index: img_assist.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/img_assist/img_assist.module,v
retrieving revision 1.68.2.49
diff -u -p -r1.68.2.49 img_assist.module
--- img_assist.module	6 Apr 2008 17:46:15 -0000	1.68.2.49
+++ img_assist.module	20 Apr 2008 02:31:04 -0000
@@ -137,7 +137,7 @@ function img_assist_textarea($element) {
     if (_img_assist_textarea_match($element['#id']) && _img_assist_page_match() && !strstr($_GET['q'], 'img_assist')) {
       if (user_access('access img_assist')) {
         $output = theme('img_assist_textarea_link', $element, $link);
-        $element['#suffix'] .= $output;
+        $element['#suffix'] = (isset($element['#suffix']) ? $element['#suffix'] . $output : $output);
       }
     }
   }
@@ -692,7 +692,7 @@ function img_assist_thumbs() {
       $tid = $browse;
     }
     
-    $output .= '<div align="center">';
+    $output = '<div align="center">';
     
     // Show by term id.
     if ($tid) {
@@ -1104,7 +1104,7 @@ function img_assist_insert_html_form() {
  */
 function img_assist_display(&$node, $size = NULL, $attributes = array()) {
   // Custom size should include values for label, width, and height.
-  if (is_array($size) && ($size['key']) && ($size['width']) && ($size['height'])) {
+  if (is_array($size) && !empty($size['key']) && !empty($size['width']) && !empty($size['height'])) {
     $label = $size['key'];
   }
   // Standard size.
@@ -1122,6 +1122,7 @@ function img_assist_display(&$node, $siz
   }
   
   // Regenerate images if necessary.
+  $regen = FALSE;
   if (!isset($node->images[$label])) {
     $regen = TRUE;
   }
@@ -1142,7 +1143,7 @@ function img_assist_display(&$node, $siz
     // be updated.
     if (!is_array($size)) {
       foreach (image_get_sizes() as $std_size) {
-        if ($std_size['key'] == $label) {
+        if (isset($std_size['key']) && $std_size['key'] == $label) {
           $size = $std_size;
           break;
         }
@@ -1599,12 +1600,13 @@ function theme_img_assist_textarea_link(
   else {
     $link = t('Add image');
   }
-  $output .= l($link, 'img_assist/load/textarea', array(
-    'class' => 'img_assist-link',
-    'id' => 'img_assist-link-'. $element['#id'],
-    'title' => t('Click here to add images'),
+  $attribs = array(
+    'class'   => 'img_assist-link',
+    'id'      => 'img_assist-link-'. $element['#id'],
+    'title'   => t('Click here to add images'),
     'onclick' => 'window.open(this.href, \'img_assist_link\', \'width=600,height=350,scrollbars=yes,status=yes,resizable=yes,toolbar=no,menubar=no\'); return false;',
-  ), 'textarea='. $element['#name'], NULL, FALSE, TRUE);
+  );
+  $output .= l($link, 'img_assist/load/textarea', $attribs, 'textarea='. $element['#name'], NULL, FALSE, TRUE);
   $output .= '</div>';
   return $output;
 }
@@ -1697,7 +1699,7 @@ function theme_img_assist_popup($content
 
 function theme_img_assist_page($content, $attributes = NULL) {
   $title = drupal_get_title();
-  $output .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n";
+  $output = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n";
   $output .= '<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">'."\n";
   $output .= "<head>\n";
   $output .= '<title>'. $title ."</title>\n";
