HOR-762
This commit is contained in:
@@ -3436,8 +3436,8 @@ msgstr "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified
|
|||||||
# TRANSLATION
|
# TRANSLATION
|
||||||
# LABEL/ID_UPLOAD_ERR_INI_SIZE
|
# LABEL/ID_UPLOAD_ERR_INI_SIZE
|
||||||
#: LABEL/ID_UPLOAD_ERR_INI_SIZE
|
#: LABEL/ID_UPLOAD_ERR_INI_SIZE
|
||||||
msgid "The uploaded file exceeds the upload_max_filesize directive in php.ini"
|
msgid "The uploaded file exceeds the upload_max_filesize or post_max_size directive in php.ini"
|
||||||
msgstr "The uploaded file exceeds the upload_max_filesize directive in php.ini"
|
msgstr "The uploaded file exceeds the upload_max_filesize or post_max_size directive in php.ini"
|
||||||
|
|
||||||
# TRANSLATION
|
# TRANSLATION
|
||||||
# LABEL/ID_NOT_PROCESS_RELATED
|
# LABEL/ID_NOT_PROCESS_RELATED
|
||||||
|
|||||||
@@ -2562,7 +2562,7 @@ SELECT 'LABEL','ID_UPLOAD_ERR_PARTIAL','en','The uploaded file was only partiall
|
|||||||
UNION ALL
|
UNION ALL
|
||||||
SELECT 'LABEL','ID_UPLOAD_ERR_FORM_SIZE','en','The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form','2014-01-15'
|
SELECT 'LABEL','ID_UPLOAD_ERR_FORM_SIZE','en','The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form','2014-01-15'
|
||||||
UNION ALL
|
UNION ALL
|
||||||
SELECT 'LABEL','ID_UPLOAD_ERR_INI_SIZE','en','The uploaded file exceeds the upload_max_filesize directive in php.ini','2014-01-15'
|
SELECT 'LABEL','ID_UPLOAD_ERR_INI_SIZE','en','The uploaded file exceeds the upload_max_filesize or post_max_size directive in php.ini','2014-01-15'
|
||||||
UNION ALL
|
UNION ALL
|
||||||
SELECT 'LABEL','ID_NOT_PROCESS_RELATED','en','Not from a Process','2014-01-15'
|
SELECT 'LABEL','ID_NOT_PROCESS_RELATED','en','Not from a Process','2014-01-15'
|
||||||
UNION ALL
|
UNION ALL
|
||||||
|
|||||||
@@ -1994,7 +1994,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
|||||||
( 'LABEL','ID_UPLOAD_ERR_NO_FILE','en','No file was uploaded','2014-01-15') ,
|
( 'LABEL','ID_UPLOAD_ERR_NO_FILE','en','No file was uploaded','2014-01-15') ,
|
||||||
( 'LABEL','ID_UPLOAD_ERR_PARTIAL','en','The uploaded file was only partially uploaded','2014-01-15') ,
|
( 'LABEL','ID_UPLOAD_ERR_PARTIAL','en','The uploaded file was only partially uploaded','2014-01-15') ,
|
||||||
( 'LABEL','ID_UPLOAD_ERR_FORM_SIZE','en','The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form','2014-01-15') ,
|
( 'LABEL','ID_UPLOAD_ERR_FORM_SIZE','en','The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form','2014-01-15') ,
|
||||||
( 'LABEL','ID_UPLOAD_ERR_INI_SIZE','en','The uploaded file exceeds the upload_max_filesize directive in php.ini','2014-01-15') ,
|
( 'LABEL','ID_UPLOAD_ERR_INI_SIZE','en','The uploaded file exceeds the upload_max_filesize or post_max_size directive in php.ini','2014-01-15') ,
|
||||||
( 'LABEL','ID_NOT_PROCESS_RELATED','en','Not from a Process','2014-01-15') ,
|
( 'LABEL','ID_NOT_PROCESS_RELATED','en','Not from a Process','2014-01-15') ,
|
||||||
( 'LABEL','ID_EXTERNAL_FILE','en','External','2014-01-15') ,
|
( 'LABEL','ID_EXTERNAL_FILE','en','External','2014-01-15') ,
|
||||||
( 'LABEL','ID_INFO','en','Info','2014-01-15') ,
|
( 'LABEL','ID_INFO','en','Info','2014-01-15') ,
|
||||||
|
|||||||
@@ -60,6 +60,33 @@ if (!isset($_SESSION['USER_LOGGED'])) {
|
|||||||
</script>');
|
</script>');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If you can, you may want to set post_max_size to a low value (say 1M) to make
|
||||||
|
* testing easier. First test to see how your script behaves. Try uploading a file
|
||||||
|
* that is larger than post_max_size. If you do you will get a message like this
|
||||||
|
* in your error log:
|
||||||
|
*
|
||||||
|
* [09-Jun-2010 19:28:01] PHP Warning: POST Content-Length of 30980857 bytes exceeds
|
||||||
|
* the limit of 2097152 bytes in Unknown on line 0
|
||||||
|
*
|
||||||
|
* This makes the script is not completed.
|
||||||
|
*
|
||||||
|
* Solving the problem:
|
||||||
|
* The PHP documentation http://php.net/manual/en/ini.core.php#ini.post-max-size
|
||||||
|
* provides a hack to solve this problem:
|
||||||
|
*
|
||||||
|
* If the size of post data is greater than post_max_size, the $_POST and $_FILES
|
||||||
|
* superglobals are empty.
|
||||||
|
*/
|
||||||
|
if ($_SERVER['REQUEST_METHOD'] == 'POST' && empty($_POST) && empty($_FILES) && $_SERVER['CONTENT_LENGTH'] > 0) {
|
||||||
|
$aMessage = array();
|
||||||
|
$aMessage['MESSAGE'] = G::loadTranslation('ID_UPLOAD_ERR_INI_SIZE');
|
||||||
|
$G_PUBLISH = new Publisher();
|
||||||
|
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
|
||||||
|
G::RenderPage('publish', 'blank');
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($_GET['APP_UID'] !== $_SESSION['APPLICATION']) {
|
if ($_GET['APP_UID'] !== $_SESSION['APPLICATION']) {
|
||||||
throw new Exception( G::LoadTranslation( 'ID_INVALID_APPLICATION_ID_MSG', array ('<a href=\'' . $_SERVER['HTTP_REFERER'] . '\'>{1}</a>',G::LoadTranslation( 'ID_REOPEN' ) ) ) );
|
throw new Exception( G::LoadTranslation( 'ID_INVALID_APPLICATION_ID_MSG', array ('<a href=\'' . $_SERVER['HTTP_REFERER'] . '\'>{1}</a>',G::LoadTranslation( 'ID_REOPEN' ) ) ) );
|
||||||
|
|||||||
Reference in New Issue
Block a user