<img src="http://example.com/moodle/file.php/22/mypicture.jpg" />get encoded as
<img src="$@FILEPHP@$mypicture.jpg" />Then on restore they get put back, only with the correct course id for the restored course - and similarly for links to activity modules, and so on.
Now this was not being done for links hidden inside blocks . This is because the content for, say, an HTML block is stored in the database in the block_instance.configdata column, which contains base64_encode(serialize($this->config)) - which means that the link is totally obfuscated.
I have just fixed this in Moodle 1.9 and HEAD. See MDL-12066 . If you block's configdata column may contain links, and if you want them backed up and restored properly, then you will need to implement the methods backup_encode_absolute_links_in_config and restore_decode_absolute_links_in_config in your block class. There is documentation of these methods in the base class in /blocks/moodleblock.class.php, and an good example of the kind of thing you have to do in the HTML block /blocks/html/block_html.php - you will see that what you have to do is actually quite simple, and adding these methods won't stop your block working with older versions of Moodle.
I have only fixed the HTML block, because that was the only one causing pain for our users. Actually, I can't think of any other standard blocks that contain links right now.