Jump to content


Photo

SMF 2.0.X - HTML Entities in topic title


Origin topic

Converting from SMF v2.0.2 -> IPB v3.3.3

When a topic includes HTML Entities (or is converted within the PHP conversion process), you can exceed the length of the varchar column:
mySQL query error: INSERT INTO topics (`title`,`start_date`,`pinned`,`forum_id`,`starter_id`,`starter_name`,`last_poster_id`,`poll_state`,`posts`,`views`,`state`,`topic_queuedposts`,`approved`,`title_seo`) VALUES('จำหน่าย วัตถุดิบ,อุปกรณ์หนังเทียม จุ๊บต',1303292423,0,33,218433,'Add9300',217242,'',2,10,'open',0,1,'-')

SQL error: Data too long for column 'title' at row 1
SQL error code: 1406
Sidenote: it does not include &amp, it is actually just &. Without converting to &amp, it displays the actual entities (จำหน่าย วัตถุดิบ,อุปกรณ์หนังเทียม จุ๊บต) in this thread instead of the entity code.

A fix that I created was on line 750(ish):
$save = array(
'title' => $row['subject'],

Replace with:
$save = array(
'title' => substr($row['subject'], 0, 250),

Status: Cannot Reproduce
Version: 1.2.3
Fixed In: 0


2 Comments

Photo
MisterPhilip
Jul 08 2012 04:38 PM
I should note the file for the fix is (Totally forgot it)
/admin/applications_addon/ips/convert/modules_admin/board/smf.php Line 753
Updating Fixed In to: 0
Updating Status to: Cannot Reproduce
Updating Version to: 1.2.3

-