This commit is contained in:
Roly Rudy Gutierrez Pinto
2016-04-14 17:36:52 -04:00
parent a51721f684
commit b279e28de8
4 changed files with 31 additions and 4 deletions

View File

@@ -3436,8 +3436,8 @@ msgstr "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified
# TRANSLATION
# 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"
msgstr "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 or post_max_size directive in php.ini"
# TRANSLATION
# LABEL/ID_NOT_PROCESS_RELATED

View File

@@ -2562,7 +2562,7 @@ SELECT 'LABEL','ID_UPLOAD_ERR_PARTIAL','en','The uploaded file was only partiall
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'
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
SELECT 'LABEL','ID_NOT_PROCESS_RELATED','en','Not from a Process','2014-01-15'
UNION ALL

View File

@@ -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_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_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_EXTERNAL_FILE','en','External','2014-01-15') ,
( 'LABEL','ID_INFO','en','Info','2014-01-15') ,

View File

@@ -60,6 +60,33 @@ if (!isset($_SESSION['USER_LOGGED'])) {
</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 {
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' ) ) ) );