Commit 2b3126b2 authored by Dries's avatar Dries

Patch #19934 by Morbus, chx: conf_init() should strip out port numbers in bootstrap.inc.

parent 804054f3
......@@ -115,7 +115,7 @@ function conf_init() {
$confdir = 'sites';
$uri = explode('/', $_SERVER['PHP_SELF']);
$server = explode('.', rtrim($_SERVER['HTTP_HOST'], '.'));
$server = explode('.', str_replace(':', '.', rtrim($_SERVER['HTTP_HOST'], '.')));
for ($i = count($uri) - 1; $i > 0; $i--) {
for ($j = count($server); $j > 0; $j--) {
$dir = implode('.', array_slice($server, -$j)) . implode('.', array_slice($uri, 0, $i));
......
......@@ -284,6 +284,7 @@ function comment_nodeapi(&$node, $op, $arg = 0) {
case 'search result':
$comments = db_result(db_query('SELECT comment_count FROM {node_comment_statistics} WHERE nid = %d', $node->nid));
return format_plural($comments, '1 comment', '%count comments');
case 'rss item':
return array(array('key' => 'comments', 'value' => url('node/'.$node->nid, NULL, 'comment', TRUE)));
}
......
......@@ -284,6 +284,7 @@ function comment_nodeapi(&$node, $op, $arg = 0) {
case 'search result':
$comments = db_result(db_query('SELECT comment_count FROM {node_comment_statistics} WHERE nid = %d', $node->nid));
return format_plural($comments, '1 comment', '%count comments');
case 'rss item':
return array(array('key' => 'comments', 'value' => url('node/'.$node->nid, NULL, 'comment', TRUE)));
}
......
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