View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000881 | XMB1 | Bugs | public | 2026-01-24 00:07 | 2026-01-24 00:07 |
| Reporter | lottos | Assigned To | |||
| Priority | low | Severity | tweak | Reproducibility | always |
| Status | new | Resolution | open | ||
| Product Version | 1.9.12.06 | ||||
| Summary | 0000881: post.php edit truncation issue - probably all xmb versions | ||||
| Description | xmb_posts.subject is TINYTEXT (can exceed 128 chars, up to 255?) xmb_threads.subject is VARCHAR(128) When editing the FIRST post in a thread, XMB updates BOTH tables. If subject exceeds threads.subject length, MySQL throws: "Data too long for column 'subject' (errno 1406)" New-topic posting already truncates correctly, but the EDIT path did not. To preserve full subject in posts while keeping threads safe: - Clone the already-escaped subject - Truncate ONLY the copy used for xmb_threads - Never modify $dbsubject (used by xmb_posts) This prevents edit-time errors without changing schema or behaviour. clone subject for threads // $dbsubject is already escaped at this point, so replace: if ((int) $isfirstpost['pid'] == $pid) { $db->query("UPDATE ".X_PREFIX."threads SET icon='$sql_posticon', subject='$dbsubject' WHERE tid=$tid"); } with if ((int) $isfirstpost['pid'] == $pid) { $dbtsubject = $dbsubject; // enforce threads.subject length $query = $db->query("SELECT subject FROM ".X_PREFIX."threads WHERE 1=0"); $tsubmax = $db->field_len($query, 0); $db->free_result($query); if (strlen($dbtsubject) > $tsubmax) { $dbtsubject = substr($dbtsubject, 0, $tsubmax); } $db->query("UPDATE ".X_PREFIX."threads SET icon='$posticon', subject='$dbtsubject' WHERE tid=$tid"); } OR the DB schema could be changed :) | ||||
| Steps To Reproduce | When editing the FIRST post in a thread, XMB updates BOTH tables. If subject exceeds threads.subject length, MySQL throws: "Data too long for column 'subject' (errno 1406)" | ||||
| Tags | No tags attached. | ||||
| MySQL Version | |||||
| PHP Version | |||||
| Web Server | |||||
| Browser | |||||
| Flags | |||||
| Original Reporter | |||||
| SVN Revision | |||||
| Git Commit | |||||
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2026-01-24 00:07 | lottos | New Issue |