rg=0
[squirrelmail.git] / plugins / squirrelspell / modules / check_me.mod
index 370241f1621628dd66fc9c772496bae6dfb1415e..41cfd15c8855cb6b28304d6d95e101b8e5825b48 100644 (file)
@@ -36,8 +36,10 @@ function SpellLink($jscode, $title, $link) {
 /**
  * Declaring globals for users with E_ALL set.
  */
-global $sqspell_text, $SQSPELL_APP, $sqspell_use_app, $attachment_dir,
-  $username, $SQSPELL_EREG, $color;
+global $SQSPELL_APP, $attachment_dir, $SQSPELL_EREG, $color;
+
+$sqspell_text = $_POST['sqspell_text'];
+$sqspell_use_app = $_POST['sqspell_use_app'];
 
 /**
  * Now we explode the lines for three reasons:
@@ -163,13 +165,15 @@ for ($i=0; $i<sizeof($sqspell_output); $i++){
      */
     if (!$SQSPELL_EREG("\n$sqspell_word\n", $words)){
       $sqspell_symb=intval($tmparray[3])-1;
-      if (!$misses[$sqspell_word]) {
+      if (!isset($misses[$sqspell_word])) {
         $misses[$sqspell_word] = $right;
         $missed_words[$errors] = $sqspell_word;
         $errors++;
       }
-      if ($locations[$sqspell_word]){
+      if (isset($locations[$sqspell_word])){
         $locations[$sqspell_word] .= ', ';
+      } else { 
+        $locations[$sqspell_word] = '';
       }
       $locations[$sqspell_word] .= "$current_line:$sqspell_symb";
     }