- Patch #931520 by David_Rothstein: [site:url-brief] token puts an unnecessary slash at the end.

merge-requests/26/head
Dries Buytaert 2010-10-28 01:33:41 +00:00
parent 7c95deecb1
commit d432737d8e
2 changed files with 2 additions and 2 deletions

View File

@ -1578,7 +1578,7 @@ class TokenReplaceTestCase extends DrupalWebTestCase {
$tests['[site:slogan]'] = check_plain(variable_get('site_slogan', ''));
$tests['[site:mail]'] = 'simpletest@example.com';
$tests['[site:url]'] = url('<front>', $url_options);
$tests['[site:url-brief]'] = preg_replace('!^https?://!', '', url('<front>', $url_options));
$tests['[site:url-brief]'] = preg_replace(array('!^https?://!', '!/$!'), '', url('<front>', $url_options));
$tests['[site:login-url]'] = url('user', $url_options);
// Test to make sure that we generated something for each token.

View File

@ -165,7 +165,7 @@ function system_tokens($type, $tokens, array $data = array(), array $options = a
break;
case 'url-brief':
$replacements[$original] = preg_replace('!^https?://!', '', url('<front>', $url_options));
$replacements[$original] = preg_replace(array('!^https?://!', '!/$!'), '', url('<front>', $url_options));
break;
case 'login-url':