When a notice is created, all its links are added to the "file" table in the database. This records the media type, etc of the link.
However, e-mail addresses are not recorded properly. If you enter an e-mail address like "[email protected]", the URL stored in the file table is "http://@example.net/". This is caused by code in the File_redirection class that adds "http://" to the front of any URL which doesn't seem to have a scheme. The first thing I've done in this patch is modify that code to insert "mailto:" instead of "http://" in the case that a schemeless URL contains an '@' sign. This improves matters, with the correct "mailto:" URL being stored in the database. However, alongside that, the other bits of data in this table are junk. e.g. the media type is recorded as "m". So the second modification I've made is to check if the canonical URL matches /^(https?|ftp):/i and only attempt to store media type, size, etc data if it does. I've tested it on my own installation and it seems to work well. I'd appreciate it if someone could commit it to mainline: http://buzzword.org.uk/2009/statusnet-0.9.x-file-table-fix.diff -- Toby A Inkster <mailto:[email protected]> <http://tobyinkster.co.uk> _______________________________________________ StatusNet-dev mailing list [email protected] http://lists.status.net/mailman/listinfo/statusnet-dev
