Skip to content

Commit e6cc040

Browse files
committed
fix: correct regex escape sequences in sanitizeFilename and DateTime type check
1 parent d66c49b commit e6cc040

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ObjectSerializer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n
117117
*/
118118
public static function sanitizeFilename($filename): string
119119
{
120-
if (preg_match('/.*[\/\\\](.*)$/', $filename, $match)) {
120+
if (preg_match('/.*[\\/\\\\](.*)$/', $filename, $match)) {
121121
return $match[1];
122122
}
123123

@@ -229,7 +229,7 @@ public static function toQueryValue(
229229
}
230230

231231
// Handle DateTime objects in query
232-
if ($openApiType === '\DateTime' && $value instanceof \DateTimeImmutable) {
232+
if ($openApiType === '\\DateTime' && $value instanceof \DateTimeImmutable) {
233233
return ["{$paramName}" => $value->format(self::$dateTimeFormat)];
234234
}
235235

0 commit comments

Comments
 (0)