You are here

function pathauto_clean_token_values in Pathauto 7

Same name and namespace in other branches
  1. 5.2 pathauto.inc \pathauto_clean_token_values()
  2. 6.2 pathauto.inc \pathauto_clean_token_values()
  3. 6 pathauto.inc \pathauto_clean_token_values()

Clean tokens so they are URL friendly.

Parameters

$replacements: An array of token replacements that need to be "cleaned" for use in the URL.

$data: An array of objects used to generate the replacements.

$options: An array of options used to generate the replacements.

1 call to pathauto_clean_token_values()
PathautoTokenTestCase::testPathautoTokens in ./pathauto.test
1 string reference to 'pathauto_clean_token_values'
pathauto_create_alias in ./pathauto.inc
Apply patterns to create an alias.

File

./pathauto.inc, line 622
Miscellaneous functions for Pathauto.

Code

function pathauto_clean_token_values(&$replacements, $data = array(), $options = array()) {
  foreach ($replacements as $token => $value) {

    // Only clean non-path tokens.
    if (!preg_match('/(path|alias|url|url-brief)\\]$/', $token)) {
      $replacements[$token] = pathauto_cleanstring($value, $options);
    }
  }
}