Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 50794b6

Browse filesBrowse files
author
Amrouche Hamza
committed
[HttpFoundation] Incorrect documentation and method name for UploadedFile::getClientSize()
1 parent 8e7eac6 commit 50794b6
Copy full SHA for 50794b6

File tree

1 file changed

+16
-0
lines changed
Filter options

1 file changed

+16
-0
lines changed

‎src/Symfony/Component/HttpFoundation/File/UploadedFile.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/File/UploadedFile.php
+16Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,24 @@ public function guessClientExtension()
142142
* Then it should not be considered as a safe value.
143143
*
144144
* @return int|null The file size
145+
* @deprecated since 4.1 will be removed in 5.0 use getFileSize instead.
145146
*/
146147
public function getClientSize()
148+
{
149+
@trigger_error(sprintf('%s is deprecated since 4.1 and will be removed in 5.0 use %s::%s.', __METHOD__, __CLASS__, 'getSize'), E_USER_DEPRECATED);
150+
151+
return $this->size;
152+
}
153+
154+
/**
155+
* Returns the file size.
156+
*
157+
* It is calculated from $_FILES['fileupload']['size'] which is computed by PHP.
158+
* Then it should be considered as a safe value.
159+
*
160+
* @return int|null The file size
161+
*/
162+
public function getFileSize()
147163
{
148164
return $this->size;
149165
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.