Skip to content

Navigation Menu

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 df51428

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

File tree

1 file changed

+18
-1
lines changed
Filter options

1 file changed

+18
-1
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/File/UploadedFile.php
+18-1Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,26 @@ public function guessClientExtension()
141141
* It is extracted from the request from which the file has been uploaded.
142142
* Then it should not be considered as a safe value.
143143
*
144-
* @return int|null The file size
144+
* @deprecated since 4.1 will be removed in 5.0 use getFileSize instead.
145+
*
146+
* @return int|null The file sizes
145147
*/
146148
public function getClientSize()
149+
{
150+
@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);
151+
152+
return $this->size;
153+
}
154+
155+
/**
156+
* Returns the file size.
157+
*
158+
* It is calculated from $_FILES['fileupload']['size'] which is computed by PHP.
159+
* Then it should be considered as a safe value.
160+
*
161+
* @return int|null The file size
162+
*/
163+
public function getFileSize()
147164
{
148165
return $this->size;
149166
}

0 commit comments

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