@anonymous-piwik-user opened this Issue on August 31st 2010

If e.g. a "/" is used in the website name (e.g. using kind of hierarchy based naming convention) an error will be arisen in the logs ( fopen(), claiming for failed to open stream: No such file or directory) and no email will be sent.
It would be wise to cleanup the "PDFReports" filename, e.g.:

# diff -u API.php.1.0 API.php
--- API.php.1.0 2010-08-31 16:15:16.000000000 +0200
+++ API.php     2010-08-31 16:16:01.000000000 +0200
@@ -275,6 +275,12 @@
                $pdf->paintReport();
         }
         $outputFilename = 'Analytics report - '.$prettyDate.' - '.$websiteName.".pdf";
+        // Clean up the filename: \/:*?"<>|[]=+'`,;
+        $outputFilename = str_replace(
+            array('\\', '/', ':', '*', '?', '"', '<', '>', '|', '[', ']', '=', '+', "'", '`', ',', ';'),
+            array('_',  '_', '_', '_', '_', '',  '',  '',  '_', '_', '_', '',  '',  '',  '',  '_', '_'),
+            $outputFilename
+        );

         switch($outputType)
         {
@mattab commented on December 20th 2010 Member

the PDF filename doesn't contain the website name in trunk, following recent commits

This Issue was closed on December 20th 2010
Powered by GitHub Issue Mirror