Browse Source

Minor - Avoid notice

Yannick Warnier 12 years ago
parent
commit
eb85be64c1
2 changed files with 5 additions and 3 deletions
  1. 1 1
      main/forum/viewthread.php
  2. 4 2
      main/forum/viewthread_threaded.inc.php

+ 1 - 1
main/forum/viewthread.php

@@ -72,7 +72,7 @@ if ($origin == 'group') {
     if ($origin == 'learnpath') {
         Display::display_reduced_header();
     } else {    	
-        $interbreadcrumb[] = array('url' => 'index.php?gradebook='.$gradebook.'&search='.Security::remove_XSS(urlencode($my_search)), 'name' => $nameTools);
+        $interbreadcrumb[] = array('url' => 'index.php?'.(isset($gradebook)?'gradebook='.$gradebook.'&':'').'search='.Security::remove_XSS(urlencode($my_search)), 'name' => $nameTools);
         $interbreadcrumb[] = array('url' => 'viewforumcategory.php?forumcategory='.$current_forum_category['cat_id'].'&origin='.$origin.'&search='.Security::remove_XSS(urlencode($my_search)), 'name' => Security::remove_XSS($current_forum_category['cat_title']));
         $interbreadcrumb[] = array('url' => 'viewforum.php?forum='.Security::remove_XSS($_GET['forum']).'&origin='.$origin.'&search='.Security::remove_XSS(urlencode($my_search)), 'name' => Security::remove_XSS($current_forum['forum_title']));
         $interbreadcrumb[] = array('url' => '#', 'name' => Security::remove_XSS($current_thread['thread_title']));

+ 4 - 2
main/forum/viewthread_threaded.inc.php

@@ -272,8 +272,10 @@ if (!empty($attachment_list)) {
 }
 
 // The post has been displayed => it can be removed from the what's new array
-unset($whatsnew_post_info[$current_forum['forum_id']][$current_thread['thread_id']][$row['post_id']]);
-unset($_SESSION['whatsnew_post_info'][$current_forum['forum_id']][$current_thread['thread_id']][$row['post_id']]);
+if (isset($whatsnew_post_info[$current_forum['forum_id']][$current_thread['thread_id']][$row['post_id']])) {
+  unset($whatsnew_post_info[$current_forum['forum_id']][$current_thread['thread_id']][$row['post_id']]);
+  unset($_SESSION['whatsnew_post_info'][$current_forum['forum_id']][$current_thread['thread_id']][$row['post_id']]);
+}
 echo "</table>";
 
 // 		Displaying the thread (structure)