| Conditions | 7 | 
| Paths | 4 | 
| Total Lines | 24 | 
| Code Lines | 14 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Tests | 6 | 
| CRAP Score | 13.125 | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php | ||
| 29 | 2 | 	public function getUploadSize($path) { | |
| 30 | 2 | $uploadSize = null; | |
| 31 | |||
| 32 | 2 | $requestMethod = $this->request->getMethod(); | |
| 33 | 2 | 		$isRemoteScript = $this->isScriptName('remote.php'); | |
| 34 | // Are we uploading anything? | ||
| 35 | 2 | 		if (in_array($requestMethod, ['MOVE', 'PUT']) && $isRemoteScript) { | |
| 36 | // v1 && v2 Chunks are not scanned | ||
| 37 | if ( | ||
| 38 | \OC_FileChunking::isWebdavChunk() | ||
| 39 | || ($requestMethod === 'PUT' && strpos($path, 'uploads/') === 0) | ||
| 40 | 			) { | ||
| 41 | return null; | ||
| 42 | } | ||
| 43 | |||
| 44 | 			if ($requestMethod === 'PUT') { | ||
| 45 | 				$uploadSize = (int)$this->request->getHeader('CONTENT_LENGTH'); | ||
| 46 | 			} else { | ||
| 47 | 				$uploadSize = (int)$this->request->getHeader('OC_TOTAL_LENGTH'); | ||
| 48 | } | ||
| 49 | } | ||
| 50 | |||
| 51 | 2 | return $uploadSize; | |
| 52 | } | ||
| 53 | |||
| 64 |