Skip to content

Commit 7435162

Browse files
fix: use absolute_url to build external links
1 parent 7608a4b commit 7435162

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

html-templates/blog/blogPost.tpl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<meta name="description" content="{$Post->Summary|default:$Post->Title|escape}" />
77

88
<meta property="og:site_name" content="{Laddr::$siteName|escape}" />
9-
<meta property="og:url" content="http://{Site::getConfig(primary_hostname)}{$Post->getURL()}" />
9+
<meta property="og:url" content="{absolute_url $Post->getURL()}" />
1010
<meta property="og:type" content="article">
1111
<meta property="og:title" content="{$Post->Title|escape}" />
1212

@@ -16,7 +16,8 @@
1616
{/if}
1717

1818
<meta property="article:published_time" content="{date($.const.DATE_W3C, $Post->Published)}" />
19-
<meta property="article:author" content="http://{Site::getConfig(primary_hostname)}{$Post->Author->getURL()}" />
19+
20+
<meta property="article:author" content="{absolute_url $Post->Author->getURL()}" />
2021

2122
<meta name="twitter:card" content="summary" />
2223
<meta name="twitter:title" content="{$Post->Title|escape}" />
@@ -30,7 +31,7 @@
3031
{/if}
3132

3233
<?php
33-
34+
3435
// find best media in post
3536
$imageUrl = null;
3637

html-templates/project-updates/projectUpdates.rss.tpl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
{load_templates subtemplates/personName.tpl}
99

1010

11-
<channel rdf:about="http://{$.server.HTTP_HOST}{$.server.REQUEST_URI|escape}">
11+
<channel rdf:about="{$.server.REQUEST_URI|absolute_url|escape}">
1212
<title>{if $Project}{$Project->Title|escape} &#8212; {/if}{_ 'Project Updates'}</title>
13-
<link>http://{Site::getConfig(primary_hostname)}/project-updates{if $Project}?ProjectID={$Project->ID}{/if}</link>
13+
<link>{escape(absolute_url(tif($Project, "/project-updates?ProjectID=$Project->ID", "/project-updates")))}</link>
1414
{capture assign=projectTitleText}{$Project->Title|escape}{/capture}
1515
{capture assign=siteNameText}{Laddr::$siteName}{/capture}
1616
{if $Project}
@@ -22,16 +22,16 @@
2222
<items>
2323
<rdf:Seq>
2424
{foreach item=Update from=$data}
25-
<rdf:li rdf:resource="http://{Site::getConfig(primary_hostname)}{$Update->getURL()}"/>
25+
<rdf:li rdf:resource="{$Update->getURL()|absolute_url|escape}"/>
2626
{/foreach}
2727
</rdf:Seq>
2828
</items>
2929
</channel>
3030

3131
{foreach item=Update from=$data}
32-
<item rdf:about="http://{Site::getConfig(primary_hostname)}{$Update->getURL()}">
32+
<item rdf:about="{$Update->getURL()|absolute_url|escape}">
3333
<title>{$Update->Project->Title|escape} &#8212; {_("Update #%u")|sprintf:$Update->Number}</title>
34-
<link>http://{Site::getConfig(primary_hostname)}{$Update->getURL()}</link>
34+
<link>{$Update->getURL()|absolute_url|escape}</link>
3535
<description>{$Update->Body|escape|markdown|escape}</description>
3636
<dc:creator>{personName $Update->Creator}</dc:creator>
3737
<dc:date>{date($dwoo.const.DATE_W3C, $Update->Created)}</dc:date>

0 commit comments

Comments
 (0)