Commit 7a885c8f authored by Dries's avatar Dries

- Patch #10044 by TDobes: fixed broken links in the statistics module. In the current statistics.module, clicking a page title should lead to the appropriate page within the local site. Instead, it leads to a 404 because the / character is turned into %2F... this is due to the paths being passed through urlencode(). The attached patch removes the problematic calls to urlencode.
parent cb36ef37
......@@ -241,9 +241,9 @@ function statistics_admin_displaylog($type = 'all', $id = 0) {
// display title if possible, otherwise display path
if ($log->title)
$title = l(_statistics_column_width($log->title), urlencode($log->path), array('title' => $log->path));
$title = l(_statistics_column_width($log->title), $log->path, array('title' => $log->path));
else
$title = '('. l(_statistics_column_width($log->path), urlencode($log->path), array('title' => $log->path)) .')';
$title = '('. l(_statistics_column_width($log->path), $log->path, array('title' => $log->path)) .')';
// display url if possible, constructing our own link as may not be local
if ($log->url)
......@@ -284,7 +284,7 @@ function statistics_top_titles() {
$result = pager_query($sql, 50, 0, $sql_cnt);
while ($title = db_fetch_object($result)) {
$rows[] = array(l(_statistics_column_width($title->title, '_title', 56), urlencode($title->path)), _statistics_column_width($title->path, '_title', 56), $title->hits, format_date($title->last_hit, 'small'), ($title->title ? l(t('track title'), 'admin/logs/hits/page/'. urlencode($title->title)) : ''));
$rows[] = array(l(_statistics_column_width($title->title, '_title', 56), $title->path), _statistics_column_width($title->path, '_title', 56), $title->hits, format_date($title->last_hit, 'small'), ($title->title ? l(t('track title'), 'admin/logs/hits/page/'. urlencode($title->title)) : ''));
}
if ($pager = theme('pager', NULL, 50, 0, tablesort_pager())) {
$rows[] = array(array('data' => $pager, 'colspan' => 3));
......
......@@ -241,9 +241,9 @@ function statistics_admin_displaylog($type = 'all', $id = 0) {
// display title if possible, otherwise display path
if ($log->title)
$title = l(_statistics_column_width($log->title), urlencode($log->path), array('title' => $log->path));
$title = l(_statistics_column_width($log->title), $log->path, array('title' => $log->path));
else
$title = '('. l(_statistics_column_width($log->path), urlencode($log->path), array('title' => $log->path)) .')';
$title = '('. l(_statistics_column_width($log->path), $log->path, array('title' => $log->path)) .')';
// display url if possible, constructing our own link as may not be local
if ($log->url)
......@@ -284,7 +284,7 @@ function statistics_top_titles() {
$result = pager_query($sql, 50, 0, $sql_cnt);
while ($title = db_fetch_object($result)) {
$rows[] = array(l(_statistics_column_width($title->title, '_title', 56), urlencode($title->path)), _statistics_column_width($title->path, '_title', 56), $title->hits, format_date($title->last_hit, 'small'), ($title->title ? l(t('track title'), 'admin/logs/hits/page/'. urlencode($title->title)) : ''));
$rows[] = array(l(_statistics_column_width($title->title, '_title', 56), $title->path), _statistics_column_width($title->path, '_title', 56), $title->hits, format_date($title->last_hit, 'small'), ($title->title ? l(t('track title'), 'admin/logs/hits/page/'. urlencode($title->title)) : ''));
}
if ($pager = theme('pager', NULL, 50, 0, tablesort_pager())) {
$rows[] = array(array('data' => $pager, 'colspan' => 3));
......
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