Index: img_assist.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/img_assist/img_assist.module,v
retrieving revision 1.73
diff -u -r1.73 img_assist.module
--- img_assist.module	4 Jun 2008 01:44:51 -0000	1.73
+++ img_assist.module	29 Jun 2008 22:04:35 -0000
@@ -155,7 +155,7 @@
     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);
       }
     }
   }
@@ -239,11 +239,11 @@
     '#description' => t('Choose what to show under the textareas for which Image assist is enabled.'),
   );
   if (module_exists('taxonomy')) {
-    $vocs[0] = '<'. t('none') .'>';
+    $vocs = array(0 => '<'. t('none') .'>');
     foreach (taxonomy_get_vocabularies() as $vid => $voc) {
       $vocs[$vid] = $voc->name;
     }
-    if ($voc) {
+    if (count($vocs) > 1) {
       $form['access']['img_assist_vocabs'] = array(
         '#type' => 'select',
         '#multiple' => TRUE,
@@ -708,7 +708,7 @@
       $tid = $browse;
     }
     
-    $output .= '<div align="center">';
+    $output = '<div align="center">';
     
     // Show by term id.
     if ($tid) {
@@ -1122,7 +1122,7 @@
  */
 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.
@@ -1140,6 +1140,7 @@
   }
   
   // Regenerate images if necessary.
+  $regen = FALSE;
   if (!isset($node->images[$label])) {
     $regen = TRUE;
   }
@@ -1160,7 +1161,7 @@
     // 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;
         }
@@ -1708,7 +1709,7 @@
 
 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";
