Hi,
you have changed the function createDocxAndDownload in CreateDocx.php from:
if (isset($args[0]) && !empty($args[0])) {
$fileName = $args[0];
$completeName = explode("/", $args[0]);
$fileNameDownload = array_pop($completeName);
} else {
$fileName = 'document';
$fileNameDownload = 'document';
}
to (in 9.0 or 9.5):
if (isset($args[0]) && !empty($args[0])) {
$fileName = $args[0];
$completeName = explode(DIRECTORY_SEPARATOR, $args[0]);
$fileNameDownload = array_pop($completeName);
} else {
$fileName = 'document';
$fileNameDownload = 'document';
}
Although, the first version is not 100% correct ($fileName is not used in the explode() stmt) it worked in my case because i use "/" as path separator. The new code does not work for me for the same reason. In my opinion, you should not rely on the DIRECTORY_SEPARATOR because developers can pass either "/" or "\\" (at least on windows).
Like you did in TransformDoc.php maybe you should better unify the separators to DIRECTORY_SEPARATOR before exploding by it like in the following suggestion:
if (isset($args[0]) && !empty($args[0])) {
$fileName = str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $args[0]);
$completeName = explode(DIRECTORY_SEPARATOR, $fileName);
$fileNameDownload = array_pop($completeName);
} else {
$fileName = 'document';
$fileNameDownload = 'document';
}
Regards,
André Bernemann