Page 1 of 1
Truncated entries !
Posted: Tue Jul 25, 2006 11:17 am
by marcolino
Hi, all
I don't know if it's an error (mine ? webserver's ? s9y's ?), but I don't find any documentation about this behaviour: when posting long entries (say 65k or more), I find them truncated (to a variable size, near 60KB, however), in the mysql 'serendipity_entries.extended' text field (and hence in the blog ...). It both happens using the standard html editor or fckeditor. My websevers's PHP 'post_max_size' is set to 8M, 'upload_max_size' to 50M.
Any clue ? Is it by design or a bug ?
Thanks in advance.
Marcolino
Re: Truncated entries !
Posted: Tue Jul 25, 2006 11:18 am
by garvinhicking
Hi!
HTTP POST requests are limited to 65kb in the textarea, this is sadly a browser limitation. So you cannot post data larger than 65kb. You can split it up into 2x 65kb by using the Extended Entry field as well...
Best regards,
Garvin
Re: Truncated entries !
Posted: Tue Jul 25, 2006 2:35 pm
by marcolino
garvinhicking wrote:
...
HTTP POST requests are limited to 65kb in the textarea, this is sadly a browser limitation.
...
Hmmm ... You are right, Garvin, as ever

...
Actually I have tested it with FF 1.5 and IE 6 on a win32 platfom, and both have that limit. Googling a bit, I found there is no such limit in HTTP nor HTML specifications, it's only a browser implementation choice ... not much to do, I see ... Should it at least be possible - for s9y - to check for the data size before and after the post, and, if they do not match, issue an alert/warning/error message ?
Thanks again !
Marcolino
Re: Truncated entries !
Posted: Tue Jul 25, 2006 3:08 pm
by garvinhicking
Hi!
Sadly getting the length would depend on javascript and would be different for each used WYSIWYG editor, so implementing this would get a bit tricky :-/
Best regards,
Garvin
Re: Truncated entries !
Posted: Tue Jul 25, 2006 3:20 pm
by marcolino
I see ...

What do You suggest, then: might I put a big red note on my serendipity front page (which I would like to use as a professional community documents exchange site): "Please avoid posts bigger than 12 pages, they will be truncated !" ???
I would like to ask many more things, but I'm afraid I'm going to hit he 65k limit ...
My best regards
Marcolino
Re: Truncated entries !
Posted: Tue Jul 25, 2006 3:26 pm
by garvinhicking
Hi!
Yes, I would put such a note online on the backend. You could use an easy plugin like this to display a note on the edit entry section:
Code: Select all
<?php
class serendipity_event_sizewarning extends serendipity_event {
function introspect(&$propbag) {
global $serendipity;
$propbag->add('name', 'Sizewarnin');
$propbag->add('description', '');
$propbag->add('stackable', false);
$propbag->add('author', 'Garvin Hicking');
$propbag->add('requirements', array(
'serendipity' => '0.8',
'smarty' => '2.6.7',
'php' => '4.1.0'
));
$propbag->add('version', '1.0');
$propbag->add('event_hooks', array('backend_entry_toolbar_body' => true));
$propbag->add('groups', array('BACKEND_EDITOR'));
}
function event_hook($event, &$bag, &$eventData) {
global $serendipity;
$hooks = &$bag->get('event_hooks');
if (isset($hooks[$event])) {
switch($event) {
case 'backend_entry_toolbar_body':
echo '<h1>WARNING: NO TEXTS LONGER THAN 65kb!</h1>';
return true;
break;
default:
return false;
break;
}
} else {
return false;
}
}
}
?>
Save that as plugins/serendipitY_event_sizewarning/serendipitY_event_sizewarning.php and install it. You can modify the outputted HTML code of course.
Regards,Garvin