coppermine-gallery.com/forum

Support => cpg1.6.x Support => cpg1.6 upload => Topic started by: 406man on June 17, 2024, 10:43:48 AM

Title: Single file upload plugin – Comment length bug
Post by: 406man on June 17, 2024, 10:43:48 AM
This bug affects comments when uploading an image using the single-file method. The multiple file option is not affected.

The length of a comment is truncated to 512 characters, ignoring the setting "Maximum length of a comment" in the gallery config.

The fault lies in codebase.php in the upload_sgl plugin where the comment length is hard-coded to be 512. It should use the config value $CONFIG['max_com_size']

Line 112 is:

<textarea name="caption" rows="5" cols="40" class="textinput" onkeydown="textCounter(this, 512);" onkeyup="textCounter(this, 512);"></textarea>

Corrected:

<textarea name="caption" rows="5" cols="40" class="textinput" onkeydown="textCounter(this, {$CONFIG['max_com_size']});" onkeyup="textCounter(this, {$CONFIG['max_com_size']});"></textarea>

I've made the change in my 1.6.26 gallery and it works fine.