Piwik\ReportRenderer::makeFilenameWithExtension PHP Method

makeFilenameWithExtension() protected static method

Append $extension to $filename
protected static makeFilenameWithExtension ( string $filename, string $extension ) : string
$filename string
$extension string
return string filename with extension
    protected static function makeFilenameWithExtension($filename, $extension)
    {
        // the filename can be used in HTTP headers, remove new lines to prevent HTTP header injection
        $filename = str_replace(array("\n", "\t"), " ", $filename);
        return $filename . "." . $extension;
    }

Usage Example

Example #1
0
 public function sendToBrowserInline($filename)
 {
     $filename = ReportRenderer::makeFilenameWithExtension($filename, self::PDF_CONTENT_TYPE);
     $this->TCPDF->Output($filename, 'I');
 }
All Usage Examples Of Piwik\ReportRenderer::makeFilenameWithExtension