? LICENSE.txt
Index: pathauto.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto.inc,v
retrieving revision 1.45.2.10
diff -u -p -r1.45.2.10 pathauto.inc
--- pathauto.inc	20 Feb 2010 03:05:19 -0000	1.45.2.10
+++ pathauto.inc	29 Jun 2010 12:20:25 -0000
@@ -85,7 +85,7 @@ function _pathauto_existing_alias_data($
  * @return
  *   The cleaned string.
  */
-function pathauto_cleanstring($string, $clean_slash = TRUE) {
+function pathauto_cleanstring($string, $clean_slash = TRUE) {//, $dpm = FALSE) {static $counter=0; ++$counter; if ($dpm) {dpm('patched '.$counter); return;}
   // Default words to ignore
   $ignore_words = array(
     'a', 'an', 'as', 'at', 'before', 'but', 'by', 'for', 'from', 'is', 'in',
@@ -297,7 +297,16 @@ function pathauto_create_alias($module, 
   }
 
   // Replace the placeholders with the values provided by the module.
-  $alias = str_replace($placeholders['tokens'], $placeholders['values'], $pattern);
+  if (isset($placeholders['values_nonclean']) && !isset($placeholders['values'])) {
+    // We clean up only those placeholder values that are actually used,
+    // via a preg_replace_callback().
+    // See http://drupal.org/node/834198
+    $alias = _pathauto_pattern_replace($placeholders, $pattern);
+  }
+  else {
+    // The legacy way expects a fully cleaned-up $placeholders['values'] array.
+    $alias = str_replace($placeholders['tokens'], $placeholders['values'], $pattern);
+  }
 
   // Two or more slashes should be collapsed into one
   $alias = preg_replace('/\/+/', '/', $alias);
@@ -356,6 +365,7 @@ function pathauto_create_alias($module, 
   return $alias;
 }
 
+
 /**
  * Verify if the given path is a valid menu callback.
  *
@@ -446,12 +456,17 @@ function _pathauto_set_alias($src, $dst,
  *   Tokens for that object formatted in the way that
  *   Pathauto expects to see them.
  */
-function pathauto_get_placeholders($type, $object) {
+function pathauto_get_placeholders($type, $object, $nonclean = FALSE) {
   if (function_exists('token_get_values')) {
     $full = token_get_values($type, $object, TRUE);
     $tokens = token_prepare_tokens($full->tokens);
-    $values = pathauto_clean_token_values($full);
-    return array('tokens' => $tokens, 'values' => $values);
+    if ($nonclean === 'nonclean') {
+      return array('tokens' => $tokens, 'values_nonclean' => $full->values);
+    }
+    else {
+      $values = pathauto_clean_token_values($full);
+      return array('tokens' => $tokens, 'values' => $values);
+    }
   }
   // TODO at some point try removing this and see if install profiles have problems again.
   watchdog('Pathauto', 'It appears that you have installed Pathauto, which depends on token, but token is either not installed or not installed properly.');
@@ -479,6 +494,41 @@ function pathauto_clean_token_values($fu
   return $full->values;
 }
 
+
+function _pathauto_clean_token_value($token, $value) {
+  // If it's a "path" or "url friendly" token don't remove the "/" character
+  if (drupal_substr($token, -4, 4) === 'path' || drupal_substr($token, -8, 8) === 'path-raw' || drupal_substr($tokens, -5, 5) === 'alias') {
+    return pathauto_cleanstring($value, FALSE);
+  }
+  else {
+    return pathauto_cleanstring($value);
+  }
+}
+
+
+function _pathauto_pattern_replace($placeholders, $subject) {
+  _pathauto_pattern_replace_callback(NULL, $placeholders);
+  if (empty($placeholders['tokens'])) {
+    return $subject;
+  }
+  $regex = '/'.implode('|', array_map('preg_quote', $placeholders['tokens'])).'/';
+  return preg_replace_callback($regex, '_pathauto_pattern_replace_callback', $subject);
+  // return str_replace($placeholders['tokens'], $placeholders['values'], $subject);
+}
+
+function _pathauto_pattern_replace_callback($match, $placeholders = NULL) {
+  static $replace;
+  if (is_array($placeholders)) {
+    $replace = array_combine($placeholders['tokens'], $placeholders['values_nonclean']);
+    return;
+  }
+  if (!isset($replace[$match[0]])) {
+    return $match[0];
+  } else {
+    return _pathauto_clean_token_value($match[0], $replace[$match[0]]);
+  }
+}
+
 /**
  * Return an array of arrays for punctuation values.
  *
@@ -491,41 +541,44 @@ function pathauto_clean_token_values($fu
  *   value and a textual description.
  */
 function pathauto_punctuation_chars() {
-  $punctuation = array();
-
-  // Handle " ' ` , . - _ : ; | { [ } ] + = * & % ^ $ # @ ! ~ ( ) ? < > \
-  $punctuation['double_quotes']      = array('value' => '"', 'name' => t('Double quotes "'));
-  $punctuation['quotes']             = array('value' => "'", 'name' => t("Single quotes (apostrophe) '"));
-  $punctuation['backtick']           = array('value' => '`', 'name' => t('Back tick `'));
-  $punctuation['comma']              = array('value' => ',', 'name' => t('Comma ,'));
-  $punctuation['period']             = array('value' => '.', 'name' => t('Period .'));
-  $punctuation['hyphen']             = array('value' => '-', 'name' => t('Hyphen -'));
-  $punctuation['underscore']         = array('value' => '_', 'name' => t('Underscore _'));
-  $punctuation['colon']              = array('value' => ':', 'name' => t('Colon :'));
-  $punctuation['semicolon']          = array('value' => ';', 'name' => t('Semicolon ;'));
-  $punctuation['pipe']               = array('value' => '|', 'name' => t('Pipe |'));
-  $punctuation['left_curly']         = array('value' => '{', 'name' => t('Left curly bracket {'));
-  $punctuation['left_square']        = array('value' => '[', 'name' => t('Left square bracket ['));
-  $punctuation['right_curly']        = array('value' => '}', 'name' => t('Right curly bracket }'));
-  $punctuation['right_square']       = array('value' => ']', 'name' => t('Right square bracket ]'));
-  $punctuation['plus']               = array('value' => '+', 'name' => t('Plus +'));
-  $punctuation['equal']              = array('value' => '=', 'name' => t('Equal ='));
-  $punctuation['asterisk']           = array('value' => '*', 'name' => t('Asterisk *'));
-  $punctuation['ampersand']          = array('value' => '&', 'name' => t('Ampersand &'));
-  $punctuation['percent']            = array('value' => '%', 'name' => t('Percent %'));
-  $punctuation['caret']              = array('value' => '^', 'name' => t('Caret ^'));
-  $punctuation['dollar']             = array('value' => '$', 'name' => t('Dollar $'));
-  $punctuation['hash']               = array('value' => '#', 'name' => t('Hash #'));
-  $punctuation['at']                 = array('value' => '@', 'name' => t('At @'));
-  $punctuation['exclamation']        = array('value' => '!', 'name' => t('Exclamation !'));
-  $punctuation['tilde']              = array('value' => '~', 'name' => t('Tilde ~'));
-  $punctuation['left_parenthesis']   = array('value' => '(', 'name' => t('Left parenthesis ('));
-  $punctuation['right_parenthesis']  = array('value' => ')', 'name' => t('right parenthesis )'));
-  $punctuation['question_mark']      = array('value' => '?', 'name' => t('Question mark ?'));
-  $punctuation['less_than']          = array('value' => '<', 'name' => t('Less than <'));
-  $punctuation['greater_than']       = array('value' => '>', 'name' => t('Greater than >'));
-  $punctuation['back_slash']         = array('value' => '\\', 'name' => t('Back slash \\'));
+  static $punctuation;
 
+  if (!isset($punctuation)) {
+    $punctuation = array();
+    // Handle " ' ` , . - _ : ; | { [ } ] + = * & % ^ $ # @ ! ~ ( ) ? < > \
+    $punctuation['double_quotes']      = array('value' => '"', 'name' => t('Double quotes "'));
+    $punctuation['quotes']             = array('value' => "'", 'name' => t("Single quotes (apostrophe) '"));
+    $punctuation['backtick']           = array('value' => '`', 'name' => t('Back tick `'));
+    $punctuation['comma']              = array('value' => ',', 'name' => t('Comma ,'));
+    $punctuation['period']             = array('value' => '.', 'name' => t('Period .'));
+    $punctuation['hyphen']             = array('value' => '-', 'name' => t('Hyphen -'));
+    $punctuation['underscore']         = array('value' => '_', 'name' => t('Underscore _'));
+    $punctuation['colon']              = array('value' => ':', 'name' => t('Colon :'));
+    $punctuation['semicolon']          = array('value' => ';', 'name' => t('Semicolon ;'));
+    $punctuation['pipe']               = array('value' => '|', 'name' => t('Pipe |'));
+    $punctuation['left_curly']         = array('value' => '{', 'name' => t('Left curly bracket {'));
+    $punctuation['left_square']        = array('value' => '[', 'name' => t('Left square bracket ['));
+    $punctuation['right_curly']        = array('value' => '}', 'name' => t('Right curly bracket }'));
+    $punctuation['right_square']       = array('value' => ']', 'name' => t('Right square bracket ]'));
+    $punctuation['plus']               = array('value' => '+', 'name' => t('Plus +'));
+    $punctuation['equal']              = array('value' => '=', 'name' => t('Equal ='));
+    $punctuation['asterisk']           = array('value' => '*', 'name' => t('Asterisk *'));
+    $punctuation['ampersand']          = array('value' => '&', 'name' => t('Ampersand &'));
+    $punctuation['percent']            = array('value' => '%', 'name' => t('Percent %'));
+    $punctuation['caret']              = array('value' => '^', 'name' => t('Caret ^'));
+    $punctuation['dollar']             = array('value' => '$', 'name' => t('Dollar $'));
+    $punctuation['hash']               = array('value' => '#', 'name' => t('Hash #'));
+    $punctuation['at']                 = array('value' => '@', 'name' => t('At @'));
+    $punctuation['exclamation']        = array('value' => '!', 'name' => t('Exclamation !'));
+    $punctuation['tilde']              = array('value' => '~', 'name' => t('Tilde ~'));
+    $punctuation['left_parenthesis']   = array('value' => '(', 'name' => t('Left parenthesis ('));
+    $punctuation['right_parenthesis']  = array('value' => ')', 'name' => t('right parenthesis )'));
+    $punctuation['question_mark']      = array('value' => '?', 'name' => t('Question mark ?'));
+    $punctuation['less_than']          = array('value' => '<', 'name' => t('Less than <'));
+    $punctuation['greater_than']       = array('value' => '>', 'name' => t('Greater than >'));
+    $punctuation['back_slash']         = array('value' => '\\', 'name' => t('Back slash \\'));
+  }
+  
   return $punctuation;
 }
 
Index: pathauto.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto.info,v
retrieving revision 1.4.2.1
diff -u -p -r1.4.2.1 pathauto.info
--- pathauto.info	21 Mar 2009 00:28:54 -0000	1.4.2.1
+++ pathauto.info	29 Jun 2010 12:20:25 -0000
@@ -5,3 +5,10 @@ dependencies[] = path
 dependencies[] = token
 suggests[] = path_redirect
 core = 6.x
+
+; Information added by drupal.org packaging script on 2010-02-27
+version = "6.x-1.3"
+core = "6.x"
+project = "pathauto"
+datestamp = "1267299906"
+
Index: pathauto_taxonomy.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto_taxonomy.inc,v
retrieving revision 1.39.2.2
diff -u -p -r1.39.2.2 pathauto_taxonomy.inc
--- pathauto_taxonomy.inc	28 Aug 2008 16:16:31 -0000	1.39.2.2
+++ pathauto_taxonomy.inc	29 Jun 2010 12:20:26 -0000
@@ -103,7 +103,7 @@ function taxonomy_pathauto_bulkupdate() 
 function _taxonomy_pathauto_alias($category, $op) {
   $count = 0;
 
-  $placeholders = pathauto_get_placeholders('taxonomy', $category);
+  $placeholders = pathauto_get_placeholders('taxonomy', $category, 'nonclean');
 
   $forum_vid = variable_get('forum_nav_vocabulary', '');
   // If we're in a forum vocabulary, also create a forum container, forum, or forum topic alias.
