original_string: private function sanitize($filename)
      {
          $filename = preg_replace('/[^A-Za-z0-9\-\._]/', '.', (string) $filename);
          return trim(substr(preg_replace('/[_\.\-]{2,}/', '.', $filename), 0, 40), '._-');
      }
code: private function sanitize($filename)
      {
          $filename = preg_replace('/[^A-Za-z0-9\-\._]/', '.', (string) $filename);
          return trim(substr(preg_replace('/[_\.\-]{2,}/', '.', $filename), 0, 40), '._-');
      }
code_tokens: private function sanitize ( $ filename ) { $ filename = preg_replace ( '/[^A-Za-z0-9\-\._]/' , '.' , ( string ) $ filename ) ; return trim ( substr ( preg_replace ( '/[_\.\-]{2,}/' , '.' , $ filename ) , 0 , 40 ) , '._-' ) ; }
docstring: Sanitizes filename.
  
  @param  string $filename The filename
  @return string A safe filename
docstring_tokens: Sanitizes filename .