forked from loafle/openapi-generator-original
[PHP] Fix string length validation (#7953)
* Add a test case which reproduces the issue https://github.com/swagger-api/swagger-codegen/issues/7846 * Change `strlen` -> `mb_strlen` in order to count the length correctly * Regenerate the samples
This commit is contained in:
committed by
William Cheng
parent
37faaf9266
commit
4a5d16b236
@@ -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(), '');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user