Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
isPut example
return
[
'Enlight_Controller_Front_PreDispatch' => 'validateContentLength',
]
;
}
/** * @throws UploadMaxSizeException */
public
function
validateContentLength
(
Enlight_Controller_EventArgs
$args
)
{
$checkRequest
=
$args
->
getRequest
(
)
->
isPost
(
)
||
$args
->
getRequest
(
)
->
isPut
(
)
;
$exceptionAlreadyThrown
=
$this
->
hasUploadMaxSizeExceptions
(
$args
->
getResponse
(
)
)
;
if
(
!
$checkRequest
||
$exceptionAlreadyThrown
)
{
return
;
}
if
(
!
$this
->
hasPostMaxSizeBeenExceeded
(
$args
->
getRequest
(
)
)
)
{
return
;
}
throw
new
UploadMaxSizeException
(
)
;
}