[pmwiki-users] underscores in file names ?

David Pilling pmwiki at pilling.demon.co.uk
Mon Jan 28 10:00:16 CST 2013


FWIW when I added underscore in wiki page names to the Pacific Bulb
Society wiki, this is the code I added to the config file. Two chunks
were needed. One at the start, one further down.

## Allow underscore in page name DJP 2012-03-01
## must appear before any page name functions called

function AsSpacedUS($text) {
  return AsSpacedUTF8(str_replace('_',' ',$text));

function MakePageNameUS($basepage, $str)
 global $MakePageNameFunction;



   $page2=MakePageName($basepage,str_replace(' ','_',$str));
   if(PageExists($page2)) $page=$page2;

  $MakePageNameFunction = 'MakePageNameUS';

$AsSpacedFunction = 'AsSpacedUS'; // has to be set up after UTF8 below
$MakePageNameFunction = 'MakePageNameUS';

// second chunk

## Enable UTF-8 (Unicode) support
# * it is better to leave it alone after instalation
# * must come before any pagename resolution
$AsSpacedFunction = 'AsSpacedUS'; // underscore names set up above

David Pilling
email: david at pilling.demon.co.uk
  web: http://www.davidpilling.net

More information about the pmwiki-users mailing list