The database schema for message does not contain imageurl.
That functionality was added later such that in the code, we rely on there being a $msg['imageurl'].
However, it is only a run time construct; it does not exist in the database. The code, however, wants to see it, so often (but not always) after retrieving a message from the code base, it looks for <center><img src=..></center> in the message body and assumes it is a urlimg (image_url_hack_extract()).
Then, just before a message is written to the db, img_url_hack_insert() converts $msg['imageurl'] to a prepended <center><img src=></center> in the message body.
They are intended to be paired so we do not have to add it to the schema. However, they are not always paired. Create a MessageObject of some type that abstracts this away entirely.
Alternately, just make imageurl an actual db object instead of the current hack in message body.
The database schema for message does not contain
imageurl.That functionality was added later such that in the code, we rely on there being a
$msg['imageurl'].However, it is only a run time construct; it does not exist in the database. The code, however, wants to see it, so often (but not always) after retrieving a message from the code base, it looks for
<center><img src=..></center>in the message body and assumes it is aurlimg(image_url_hack_extract()).Then, just before a message is written to the db,
img_url_hack_insert()converts$msg['imageurl']to a prepended<center><img src=></center>in the message body.They are intended to be paired so we do not have to add it to the schema. However, they are not always paired. Create a
MessageObjectof some type that abstracts this away entirely.Alternately, just make
imageurlan actual db object instead of the current hack in message body.