Implement %HTML.AllowedComments and %HTML.AllowedCommentsRegexp
[htmlpurifier.git] / tests / path2class.func.php
blob95a3a95ae9a82578a8a9c2c52b7c67dc7d2df92a
1 <?php
3 function path2class($path) {
4 $temp = $path;
5 $temp = str_replace('./', '', $temp); // remove leading './'
6 $temp = str_replace('.\\', '', $temp); // remove leading '.\'
7 $temp = str_replace('\\', '_', $temp); // normalize \ to _
8 $temp = str_replace('/', '_', $temp); // normalize / to _
9 while(strpos($temp, '__') !== false) $temp = str_replace('__', '_', $temp);
10 $temp = str_replace('.php', '', $temp);
11 return $temp;
14 // vim: et sw=4 sts=4