I've been using this module with great success, until someone started reporting that email links were broken. I checked, and sure enough email links were being converted from "mailto:user@example.com" to "http://example.com/mailto:user@example.com". I checked the code and found a bug.
In the original module on line 351, when looking for existing absolute links before performing a relative to absolute conversion, rather than looking for "mailto:user@example.com", the module looks for "mailto://user@example.com", which is obviously incorrect.
<?php
if(substr($txt,$pos,7) != 'http://' && substr($txt,$pos,8) != 'https://' && substr($txt,$pos,6) != 'ftp://' && substr($txt,$pos,9) != 'mailto://'){
?>I fixed the error by changing the last subst statement on that line:
<?php
if(substr($txt,$pos,7) != 'http://' && substr($txt,$pos,8) != 'https://' && substr($txt,$pos,6) != 'ftp://' && substr($txt,$pos,7) != 'mailto:'){
?>Works great for me! Again, great module, and I hope this is helpful to others.
Comments
Comment #1
jbomb commentedCommitted to both 6.x and 7.x branches.
Thanks chromix!