optionally reduce patterns to ascii128
greggles - October 21, 2007 - 17:30
| Project: | Pathauto |
| Version: | 5.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | greggles |
| Status: | closed |
Description
After http://drupal.org/node/185304 some people may still want that reduction of letters to the subset "ascii96" characters represented by something similar to this preg_replace pattern:
// Preserve alphanumerics and forward slashes, everything else becomes a separator.
$pattern = '/[^a-zA-Z0-9\/]+/ ';
$output = preg_replace($pattern, $separator, $output);It would need to be expanded to accept all punctuation since we now have the punctuation control.

#1
Ok - here is the patch.
I decided against trying to handle punctuation for now.
If someone wants that they can figure out the regex (yikes).
#2
applied to both 5.x and MAIN.
#3
Reducing to ASCII128 or ASCII96? The wording is different for the form element and the code comment...
+ // Reduce to the subset of ASCII128 letters and numbers
+ $form["general"]["pathauto_reduce_ascii"] = array('#type' => 'checkbox',
+ '#title' => t('Reduce strings to letters and numbers from ASCII-96'),
+ '#default_value' => variable_get('pathauto_reduce_ascii', FALSE),
+ '#description' => t("Filters the new alias to only letters and numbers found in the ASCII-96 set."),
+ );
#4
Thanks for catching that. I took the opportunity to clean up some other comments as well.
#5
Automatically closed -- issue fixed for two weeks with no activity.