diff --git a/doc/cs/http/request.texy b/doc/cs/http/request.texy index 6ddc189d18..dc3061fad2 100644 --- a/doc/cs/http/request.texy +++ b/doc/cs/http/request.texy @@ -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`. diff --git a/doc/en/http/request.texy b/doc/en/http/request.texy index cf059f52ac..f53e7e4ef8 100644 --- a/doc/en/http/request.texy +++ b/doc/en/http/request.texy @@ -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`.