Return to Snippet

Revision: 47884
at June 17, 2011 18:51 by janlodey


Initial Code
//Use the pathauto module to snaitise your string
if (module_exists('pathauto')) {
  // add the pathauto.inc file
  require_once(drupal_get_path('module', 'pathauto') . '/pathauto.inc');
  $termclean = pathauto_cleanstring('&%No thanks');
}

//use CTools to sanitise string - but without stripping stuff out		
ctools_include('cleanstring');
$sanestring = ctools_cleanstring('My raw string');

Initial URL


Initial Description


Initial Title
Drupal clean strings from template files

Initial Tags
drupal

Initial Language
PHP