Index: pathauto.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto.inc,v
retrieving revision 1.65
diff -u -p -r1.65 pathauto.inc
--- pathauto.inc	28 Feb 2010 02:01:49 -0000	1.65
+++ pathauto.inc	2 Mar 2010 19:45:21 -0000
@@ -179,12 +179,16 @@ function pathauto_cleanstring($string, $
 
   // Get rid of words that are on the ignore list
   $ignore_re = '\b' . preg_replace('/,/', '\b|\b', variable_get('pathauto_ignore_words', $ignore_words)) . '\b';
-
   if (function_exists('mb_eregi_replace')) {
-    $output = mb_eregi_replace($ignore_re, '', $output);
+    $temp_output = mb_eregi_replace($ignore_re, '', $output);
   }
   else {
-    $output = preg_replace("/$ignore_re/i", '', $output);
+    $temp_output = preg_replace("/$ignore_re/i", '', $output);
+  }
+  if (drupal_strlen(trim($temp_output)) > 0) {
+    // Only use the string with ignored words removed if it creates a non-empty
+    // string.
+    $output = $temp_output;
   }
 
   // Always replace whitespace with the separator.
Index: pathauto.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto.test,v
retrieving revision 1.2
diff -u -p -r1.2 pathauto.test
--- pathauto.test	2 Mar 2010 19:43:02 -0000	1.2
+++ pathauto.test	2 Mar 2010 19:45:21 -0000
@@ -31,6 +31,22 @@ class PathautoUnitTestCase extends Drupa
   function testGetSchemaAliasMaxLength() {
     $this->assertIdentical(_pathauto_get_schema_alias_maxlength(), 255);
   }
+  
+  /**
+   * Test the 'ignored words' removal functionality of pathauto_cleanstring().
+   */
+  function testIgnoredWordRemoval() {
+    $tests = array(
+      'this' => 'this',
+      'this with that' => 'this-with-that',
+      'this thing with that thing' => 'thing-thing',
+    );
+    
+    foreach ($tests as $input => $expected) {
+      $output = pathauto_cleanstring($input);
+      $this->assertEqual($output, $expected, t("pathauto_cleanstring('@input') expected '@expected', actual '@output'", array('@input' => $input, '@expected' => $expected, '@output' => $output)));
+    }
+  }
 }
 
  /**
