Commit d432737d authored by Dries's avatar Dries
Browse files

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

parent 7c95deec
...@@ -1578,7 +1578,7 @@ class TokenReplaceTestCase extends DrupalWebTestCase { ...@@ -1578,7 +1578,7 @@ class TokenReplaceTestCase extends DrupalWebTestCase {
$tests['[site:slogan]'] = check_plain(variable_get('site_slogan', '')); $tests['[site:slogan]'] = check_plain(variable_get('site_slogan', ''));
$tests['[site:mail]'] = 'simpletest@example.com'; $tests['[site:mail]'] = 'simpletest@example.com';
$tests['[site:url]'] = url('<front>', $url_options); $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); $tests['[site:login-url]'] = url('user', $url_options);
// Test to make sure that we generated something for each token. // Test to make sure that we generated something for each token.
......
...@@ -165,7 +165,7 @@ function system_tokens($type, $tokens, array $data = array(), array $options = a ...@@ -165,7 +165,7 @@ function system_tokens($type, $tokens, array $data = array(), array $options = a
break; break;
case 'url-brief': case 'url-brief':
$replacements[$original] = preg_replace('!^https?://!', '', url('<front>', $url_options)); $replacements[$original] = preg_replace(array('!^https?://!', '!/$!'), '', url('<front>', $url_options));
break; break;
case 'login-url': case 'login-url':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment