From ffeb0a39f36b7f79388737cc63925d8316417a63 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 2 Apr 2011 11:20:25 +0200 Subject: [PATCH] Fixed incorrect handling of links --- install.xml | 2 ++ root/adm/style/portal/acp_portal_calendar.html | 2 +- root/portal/modules/portal_calendar.php | 11 ++++++----- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/install.xml b/install.xml index 5adeef55..29d2de32 100644 --- a/install.xml +++ b/install.xml @@ -118,6 +118,7 @@ Weitere Sprachen kannst in unserem Internationalen Forum finden: http://www.boar Fixed missing CSS for li-tags of calendar Added error handling to installation of modules Fixed timezone handling of calendar + Fixed incorrect handling of links Fehlendes IF $S_BLOCK_ICON hinzugefügt @@ -129,6 +130,7 @@ Weitere Sprachen kannst in unserem Internationalen Forum finden: http://www.boar Fehlendes CSS für li-tags des Kalenders hinzugefügt Fehlerbehandlung zu Installation von Modulen hinzugefügt Zeitzonenbehandlung in Kalender korrigiert + Falsche Behandlung von Links korrigiert diff --git a/root/adm/style/portal/acp_portal_calendar.html b/root/adm/style/portal/acp_portal_calendar.html index e77302f8..7bf27986 100644 --- a/root/adm/style/portal/acp_portal_calendar.html +++ b/root/adm/style/portal/acp_portal_calendar.html @@ -184,7 +184,7 @@ {events.EVENT_TITLE} {events.EVENT_DESC} {L_EVENT_START}: {events.EVENT_START} | {L_EVENT_END}: {events.EVENT_END}{L_EVENT_TIME}: {events.EVENT_START} | {L_EVENT_ALL_DAY} - {events.EVENT_URL} + {events.EVENT_URL_RAW} {ICON_EDIT} {ICON_DELETE} diff --git a/root/portal/modules/portal_calendar.php b/root/portal/modules/portal_calendar.php index f8b0c75d..3217e715 100644 --- a/root/portal/modules/portal_calendar.php +++ b/root/portal/modules/portal_calendar.php @@ -174,7 +174,7 @@ class portal_calendar_module if((($cur_event['start_time'] + 86400) >= $today_timestamp && $cur_event['all_day']) || ($cur_event['start_time'] <= $today_timestamp && $cur_event['end_time'] >= $today_timestamp)) { $template->assign_block_vars('cur_events', array( - 'EVENT_URL' => (isset($cur_event['url']) && $cur_event['url'] != '') ? $this->validate_url(str_replace('&', '&', $cur_event['url'])) : '', + 'EVENT_URL' => (isset($cur_event['url']) && $cur_event['url'] != '') ? $this->validate_url($cur_event['url']) : '', 'EVENT_TITLE' => $cur_event['title'], 'START_TIME' => $user->format_date($cur_event['start_time'], 'j. M Y, H:i'), 'END_TIME' => (!empty($cur_event['end_time'])) ? $user->format_date($cur_event['end_time'], 'j. M Y, H:i') : false, @@ -185,7 +185,7 @@ class portal_calendar_module else { $template->assign_block_vars('upcoming_events', array( - 'EVENT_URL' => (isset($cur_event['url']) && $cur_event['url'] != '') ? $this->validate_url(str_replace('&', '&', $cur_event['url'])) : '', + 'EVENT_URL' => (isset($cur_event['url']) && $cur_event['url'] != '') ? $this->validate_url($cur_event['url']) : '', 'EVENT_TITLE' => $cur_event['title'], 'START_TIME' => $user->format_date($cur_event['start_time'], 'j. M Y, H:i'), 'END_TIME' => $user->format_date($cur_event['end_time'], 'j. M Y, H:i'), @@ -497,7 +497,8 @@ class portal_calendar_module 'EVENT_DESC' => ($action != 'add') ? $events[$i]['desc'] : '', 'EVENT_START' => ($action != 'add') ? $user->format_date($events[$i]['start_time'], $start_time_format) : '', 'EVENT_END' => ($action != 'add' && !$event_all_day) ? $user->format_date($events[$i]['end_time'], $end_time_format) : '', - 'EVENT_URL' => ($action != 'add' && isset($events[$i]['url']) && !empty($events[$i]['url'])) ? str_replace('&', '&', $events[$i]['url']) : '', + 'EVENT_URL' => ($action != 'add' && isset($events[$i]['url']) && !empty($events[$i]['url'])) ? $this->validate_url($events[$i]['url']) : '', + 'EVENT_URL_RAW' => ($action != 'add' && isset($events[$i]['url']) && !empty($events[$i]['url'])) ? $events[$i]['url'] : '', 'U_EDIT' => $u_action . '&action=edit&id=' . $i, 'U_DELETE' => $u_action . '&action=delete&id=' . $i, 'EVENT_ALL_DAY' => $event_all_day, @@ -576,8 +577,8 @@ class portal_calendar_module $url = 'http://' . $url; } - // Is this a link to somewhere inside this board? If so then remove the session id from the url - if (strpos($url, generate_board_url()) !== false && strpos($url, 'sid=') !== false) + // Is this a link to somewhere inside this board? If so then run reapply_sid() + if (strpos($url, generate_board_url()) !== false) { $url = reapply_sid($url); }