Skip to content

Commit

Permalink
Added http:// to sitelinks to prevent errors in linking
Browse files Browse the repository at this point in the history
  • Loading branch information
Semias committed May 18, 2012
1 parent a744033 commit d29b8e9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
3 changes: 2 additions & 1 deletion inc/app/sitelinks/boxes/forward/index.php
Expand Up @@ -3,6 +3,7 @@
// your app begins here

loader_import ('sitelinks.Item');
loader_import ('sitelinks.Functions');

$item = new SiteLinks_Item;

Expand All @@ -11,7 +12,7 @@
$i = $item->get ($parameters['forward']);
if ($i) {
$item->addHit ($parameters['forward']);
header ('Location: ' . $i->url);
header ('Location: ' . AddHttp($i->url));
exit;
}

Expand Down
7 changes: 7 additions & 0 deletions inc/app/sitelinks/lib/Functions.php
Expand Up @@ -56,4 +56,11 @@ function sitelinks_timezone ($offset) {
return $out . str_pad ($h, 2, '0', STR_PAD_LEFT) . ':' . str_pad ($m, 2, '0', STR_PAD_LEFT);
}

function AddHttp($url) {
if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
$url = "http://" . $url;
}
return $url;
}

?>
10 changes: 8 additions & 2 deletions inc/app/sitepoll/forms/comment/add/index.php
Expand Up @@ -36,8 +36,14 @@ function onSubmit ($vals) {

$ce = appconf ('comments_email');
if ($ce) {
@mail ($ce, intl_get ('Poll Comment Notice'), template_simple ('comment_email.spt', $vals), 'From: ' . 'sitepoll@' . site_domain ());
}
site_mail (
$ce,
intl_get ('Poll Comment Notice'),
template_simple ('comment_email.spt', $vals),
'From: ' . 'sitepoll@' . site_domain (),
array ("Is_HTML" => true)
);
}

page_title (intl_get ('Comment Added'));
echo template_simple ('comment_added.spt', $vals);
Expand Down
8 changes: 4 additions & 4 deletions inc/conf/config.ini.php
Expand Up @@ -16,17 +16,17 @@
hostname = localhost
database = DBNAME
database = semlab_site02
username = USER
username = semlab_site02
password = PASS
password = 2yX6TBms02
persistent = Off
[Site]
domain = DOMAIN
domain = github.semiaslab.nl
usedocroot = Off
Expand Down

0 comments on commit d29b8e9

Please sign in to comment.