mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 12:40:53 +00:00
[PHP] Add path & file separator (/) to return the correct path when deserializing a file (#7671)
* Add path & file separator (/) to return the correct path Add the separator between the tempFolderPath and the sanitized filename so that the path to the file is correct. (Fixes #7670) * Remove separator from generated file * Add separator Add the separator between the tempFolderPath and the sanitized filename so that the path to the file is correct. (Fixes #7670) * Update sample code Via ./bin/php-petstore.sh
This commit is contained in:
parent
8e0a0ebd62
commit
3bcf0ff764
@ -261,7 +261,7 @@ class ObjectSerializer
|
||||
// determine file name
|
||||
if (array_key_exists('Content-Disposition', $httpHeaders) &&
|
||||
preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) {
|
||||
$filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . self::sanitizeFilename($match[1]);
|
||||
$filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]);
|
||||
} else {
|
||||
$filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), '');
|
||||
}
|
||||
|
@ -271,7 +271,7 @@ class ObjectSerializer
|
||||
// determine file name
|
||||
if (array_key_exists('Content-Disposition', $httpHeaders) &&
|
||||
preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) {
|
||||
$filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . self::sanitizeFilename($match[1]);
|
||||
$filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]);
|
||||
} else {
|
||||
$filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), '');
|
||||
}
|
||||
|
@ -14,8 +14,8 @@
|
||||
|
||||
<filter>
|
||||
<whitelist processUncoveredFilesFromWhitelist="true">
|
||||
<directory suffix=".php">./lib/Api</directory>
|
||||
<directory suffix=".php">./lib/Model</directory>
|
||||
<directory suffix=".php">./lib\Api</directory>
|
||||
<directory suffix=".php">./lib\Model</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
||||
|
Loading…
x
Reference in New Issue
Block a user