[Rt-commit] rt branch, 4.0/avoid-absolute-links, updated. rt-4.0.4-186-g65cb878
? sunnavy
sunnavy at bestpractical.com
Tue Jan 17 14:04:56 EST 2012
The branch, 4.0/avoid-absolute-links has been updated
via 65cb87851b4710449c8ff98bb4ae5376b15ef5aa (commit)
from e514ec3718419767cfbb5df619f024bc4ce8dc38 (commit)
Summary of changes:
share/html/Elements/ShowLink | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
- Log -----------------------------------------------------------------
commit 65cb87851b4710449c8ff98bb4ae5376b15ef5aa
Author: sunnavy <sunnavy at bestpractical.com>
Date: Wed Jan 18 03:03:35 2012 +0800
it's more clear to use URI->rel
diff --git a/share/html/Elements/ShowLink b/share/html/Elements/ShowLink
index 7c8b11d..1727fa3 100644
--- a/share/html/Elements/ShowLink
+++ b/share/html/Elements/ShowLink
@@ -74,6 +74,7 @@ $URI => undef
my $href = $URI->Resolver->HREF;
if ( $URI->IsLocal ) {
my $base = RT->Config->Get('WebBaseURL');
- $href =~ s!^$base!!;
+ # URI->rel doesn't contain the leading '/'
+ $href = '/' . URI->new($href)->rel($base);
}
</%INIT>
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list