? nbproject
Index: pathauto.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto.inc,v
retrieving revision 1.71
diff -u -p -r1.71 pathauto.inc
--- pathauto.inc	14 Mar 2010 06:02:31 -0000	1.71
+++ pathauto.inc	8 May 2010 14:32:58 -0000
@@ -133,10 +133,12 @@ function _pathauto_existing_alias_data($
  *   A string to clean.
  * @param $clean_slash
  *   Whether to clean slashes from the given string.
+ * @param $remove_ignore_words
+ *   Whether to remove ignore words from the given string.
  * @return
  *   The cleaned string.
  */
-function pathauto_cleanstring($string, $clean_slash = TRUE) {
+function pathauto_cleanstring($string, $clean_slash = TRUE, $remove_ignore_words = TRUE) {
   // Default words to ignore
   $ignore_words = array(
     'a', 'an', 'as', 'at', 'before', 'but', 'by', 'for', 'from', 'is', 'in',
@@ -177,14 +179,17 @@ function pathauto_cleanstring($string, $
     $output = preg_replace($pattern, $separator, $output);
   }
 
-  // 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';
+  // Path or URL related tokens should not have ignore words removed.
+  if ($remove_ignore_words) {
+    // 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);
-  }
-  else {
-    $output = preg_replace("/$ignore_re/i", '', $output);
+    if (function_exists('mb_eregi_replace')) {
+      $output = mb_eregi_replace($ignore_re, '', $output);
+    }
+    else {
+      $output = preg_replace("/$ignore_re/i", '', $output);
+    }
   }
 
   // Always replace whitespace with the separator.
@@ -484,9 +489,10 @@ function _pathauto_set_alias($source, $a
 */
 function pathauto_clean_token_values(&$replacements, $data = array(), $options = array()) {
  foreach ($replacements as $token => $value) {
-   // If it's a "path" or "url friendly" token don't remove the "/" character
+   // If it's a "path" or "url friendly" token don't remove the "/" character or
+   // the ignore words.
    if (drupal_substr($token, -5, 4) === 'path' || drupal_substr($token, -6, 5) === 'alias') {
-     $replacements[$token] = pathauto_cleanstring($value, FALSE);
+     $replacements[$token] = pathauto_cleanstring($value, FALSE, FALSE);
    }
    else {
      $replacements[$token] = pathauto_cleanstring($value);
