Fix newline issues in tests.
[htmlpurifier/darkodev.git] / tests / path2class.func.php
blob4680e4225195156cf533bc60c41b2681e1b6741f
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;