I tried to add a link protocal mms:// and rstp:// and the link would turn out to be my url + the link instead of just the link..ftp, http works fine just when I added the two new protocals to the link.module it would not work...any sugggestions...I ready had this module installed when I tried to hack it

Comments

quicksketch’s picture

Link module uses a standard set of protocols that ship with Drupal, however you can add more protocols without hacking the module at all! The list of protocols is stored in a variable, though there is no admin interface for changing this value. You can change it with two methods:

1. If you have devel module, execute this code in the "Execute PHP" block:

variable_set('filter_allowed_protocols', array('http', 'https', 'ftp', 'news', 'nntp', 'telnet', 'mailto', 'irc', 'ssh', 'sftp', 'webcal', 'mms', 'rstp'));

2. Or you can hardcode the value in your settings.php file. Scroll down to the bottom of the settings.php file and you'll find a commented out section of code like this:

# $conf = array(
#   'site_name' => 'My Drupal site',
#   'theme_default' => 'minnelli',
#   'anonymous' => 'Visitor',
# );

Change this to:

  $conf = array(
    'filter_allowed_protocols' => array('http', 'https', 'ftp', 'news', 'nntp', 'telnet', 'mailto', 'irc', 'ssh', 'sftp', 'webcal', 'mms', 'rstp');
  );

I'd also suggest replacing your link module with a fresh non-hacked copy. Hacks are bad! :D

deadlyromio’s picture

Great..I just tried option one with devel module and work on the first try. I originally opted for the section option but was getting back some errors that I couldn't fix so tried the first option which I should have in the first place...thanks for your time in answering

quicksketch’s picture

Status: Active » Fixed

Rock!

I had a typo in my second option (I used a semi-colon instead of a comma):

  $conf = array(
    'filter_allowed_protocols' => array('http', 'https', 'ftp', 'news', 'nntp', 'telnet', 'mailto', 'irc', 'ssh', 'sftp', 'webcal', 'mms', 'rstp'),
  );

But once you have it set in your database, no worries. It'll stay there nice and safe either way.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

googlg’s picture

Version: 5.x-2.1 » 7.x-1.1

I add the itms-services protocol by rewrite the settings.php file, add the following code:
$conf = array('filter_allowed_protocols' => array('itms-services','http', 'https', 'ftp', 'news', 'nntp', 'telnet','mailto', 'irc', 'ssh', 'sftp', 'webcal', 'mms', 'rstp'));