Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions doc/cs/http/request.texy
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,14 @@ getSanitizedName(): string .[method]
Vrací sanitizovaný název souboru. Obsahuje pouze ASCII znaky `[a-zA-Z0-9.-]`. Pokud název takové znaky neobsahuje, vrátí `'unknown'`. Pokud je soubor obrázek ve formátu JPEG, PNG, GIF, nebo WebP, vrátí i správnou příponu.


getUntrustedFullPath(): string .[method]
----------------------------------------
Vrací originální cestu k souboru, jak ji odeslal prohlížeč při uploadu složky. Celá cesta je dostupná pouze v PHP 8.1 a vyšším. V předchozích verzích tato metoda vrací originální název souboru.

.[caution]
Nevěřte hodnotě vrácené touto metodou. Klient mohl odeslat škodlivý název souboru s úmyslem poškodit nebo hacknout vaši aplikaci.


getSize(): int .[method]
------------------------
Vrací velikost uploadovaného souboru. V případě, že upload nebyl úspěšný, vrací `0`.
Expand Down
8 changes: 8 additions & 0 deletions doc/en/http/request.texy
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,14 @@ getSanitizedName(): string .[method]
Returns the sanitized file name. It contains only ASCII characters `[a-zA-Z0-9.-]`. If the name does not contain such characters, it returns 'unknown'. If the file is JPEG, PNG, GIF, or WebP image, it returns the correct file extension.


getUntrustedFullPath(): string .[method]
----------------------------------------
Returns the original full path as submitted by the browser during directory upload. The full path is only available in PHP 8.1 and above. In previous versions, this method returns the untrusted file name.

.[caution]
Do not trust the value returned by this method. A client could send a malicious filename with the intention to corrupt or hack your application.


getSize(): int .[method]
------------------------
Returns the size of the uploaded file. If the upload was not successful, it returns `0`.
Expand Down