Posted By

janlodey on 06/17/11


Tagged

strings drupal templates views ctools path-auto


Versions (?)

Drupal clean strings from template files


 / Published in: PHP
 

  1. //Use the pathauto module to snaitise your string
  2. if (module_exists('pathauto')) {
  3. // add the pathauto.inc file
  4. require_once(drupal_get_path('module', 'pathauto') . '/pathauto.inc');
  5. $termclean = pathauto_cleanstring('&%No thanks');
  6. }
  7.  
  8. //use CTools to sanitise string - but without stripping stuff out
  9. ctools_include('cleanstring');
  10. $sanestring = ctools_cleanstring('My raw string');

Report this snippet  

You need to login to post a comment.