document.getElementById('send').style.display = 'none';
if (!check_html5_file_api ())
document.getElementById('max_file_size').innerHTML = '<?php
- echo t('NO_BROWSER_SUPPORT') . jirafeau_get_max_upload_size();
- ?>';
+ $max_size = jirafeau_get_max_upload_size();
+ if ($max_size > 0) {
+ echo t('NO_BROWSER_SUPPORT') . $max_size;
+ }
+ ?>';
addCopyListener('upload_link_button', 'upload_link');
addCopyListener('preview_link_button', 'preview_link');
*/
function jirafeau_get_max_upload_chunk_size_bytes($max_upload_chunk_size_bytes = 0)
{
- if ($max_upload_chunk_size_bytes > 0) {
- return min(
- jirafeau_get_max_upload_size_bytes(),
- $max_upload_chunk_size_bytes
- );
+ if ($max_upload_chunk_size_bytes == 0) {
+ $size = jirafeau_get_max_upload_size_bytes();
+ // Jirafeau must choose an arbitrary number as PHP config does not give any limit nor $max_upload_chunk_size_bytes
+ if ($size == 0) {
+ return 10000000; // 10MB
+ }
+ return $size;
}
- return jirafeau_get_max_upload_size_bytes();
+
+ $size = min(
+ jirafeau_get_max_upload_size_bytes(),
+ $max_upload_chunk_size_bytes
+ );
+ if ($size == 0) {
+ return $max_upload_chunk_size_bytes;
+ }
+ return $size;
}
/**