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

greggles - November 2, 2007 - 15:30
Status:postponed» patch (code needs review)

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).

AttachmentSize
ascii96_reduction.patch2.28 KB

#2

greggles - November 5, 2007 - 12:58
Status:patch (code needs review)» fixed

applied to both 5.x and MAIN.

#3

hass - November 16, 2007 - 14:20
Category:feature request» bug report
Status:fixed» active

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

greggles - November 16, 2007 - 18:10
Status:active» fixed

Thanks for catching that. I took the opportunity to clean up some other comments as well.

#5

Anonymous - November 30, 2007 - 18:12
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.