From 921dcdc2c9622b08662fd18809ee1e19a23c00d4 Mon Sep 17 00:00:00 2001 From: TJ Date: Tue, 11 Oct 2011 09:42:25 +0100 Subject: [PATCH 01/21] 4892: PHP Undefined warnings: index_course_tmpl.php: variables $keywords, $caller_script indexes 'user_id', 'user_role' --- themes/default/home/index_course.tmpl.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/themes/default/home/index_course.tmpl.php b/themes/default/home/index_course.tmpl.php index 54f76fc7..775df2ee 100644 --- a/themes/default/home/index_course.tmpl.php +++ b/themes/default/home/index_course.tmpl.php @@ -20,6 +20,7 @@ // after adding/removing the course from "My Courses" list($caller_url, $url_param) = Utility::getRefererURLAndParams(); +$keywords = array(); if (isset($this->search_text)) $keywords = explode(' ', $this->search_text); ?> @@ -43,9 +44,9 @@ $end_num = min($this->curr_page_num * RESULTS_PER_PAGE, $num_results); ?>
  • -
    search_text<>'' ? _AT('for').' "'.$this->search_text.'"':'');?> +
    search_text) ? _AT('for').' "'.$this->search_text.'"':'');?> + if(array_key_exists('user_id', $_SESSION) && $_SESSION['user_id']){ ?> <?php echo _AT('my_authoring_course'); ?>   
    @@ -66,17 +67,17 @@ ?>
  • - + <?php echo _AT('my_authoring_course'); ?> <?php echo _AT('others_course'); ?> - + <?php echo htmlspecialchars(_AT(' title='' border="0" /> -0) {?> +0) {?> <?php echo htmlspecialchars(_AT('add_into_list')); ?> From 6e934300435f645f4f3aeb21f781ed94c961e8de Mon Sep 17 00:00:00 2001 From: TJ Date: Tue, 11 Oct 2011 09:47:41 +0100 Subject: [PATCH 02/21] 4892: PHP Undefined warnings: include/vitals.inc.php * Use maximum error reporting to ensure focus on problems * Use the correct setcookie() function variables $_custom_head indexes 'user_id' --- include/vitals.inc.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/vitals.inc.php b/include/vitals.inc.php index ab4ed7ee..c5f3b5a5 100644 --- a/include/vitals.inc.php +++ b/include/vitals.inc.php @@ -13,7 +13,7 @@ if (!defined('TR_INCLUDE_PATH')) { exit; } define('TR_DEVEL', 1); -define('TR_ERROR_REPORTING', E_ALL ^ E_NOTICE); // default is E_ALL ^ E_NOTICE, use E_ALL or E_ALL + E_STRICT for developing +define('TR_ERROR_REPORTING', E_ALL + E_STRICT); // default is E_ALL ^ E_NOTICE, use E_ALL or E_ALL + E_STRICT for developing // Emulate register_globals off. src: http://php.net/manual/en/faq.misc.php#faq.misc.registerglobals function unregister_GLOBALS() { @@ -150,7 +150,8 @@ function unregister_GLOBALS() { // set default template paths: $savant = new Savant2(); - if (isset($_SESSION['prefs']['PREF_THEME']) && file_exists(TR_INCLUDE_PATH . '../themes/' . $_SESSION['prefs']['PREF_THEME']) && $_SESSION['user_id']>0) + if (isset($_SESSION['prefs']['PREF_THEME']) && file_exists(TR_INCLUDE_PATH . '../themes/' . $_SESSION['prefs']['PREF_THEME']) + && isset($_SESSION['user_id']) && $_SESSION['user_id']>0) { if (!is_dir(TR_INCLUDE_PATH . '../themes/' . $_SESSION['prefs']['PREF_THEME'])) { @@ -270,11 +271,11 @@ function unregister_GLOBALS() { $_SESSION['flash'] = $_COOKIE["flash"]; //delete the cookie - AContent.setcookie("flash",'',time()-3600); + setcookie("flash",'',time()-3600); } if (!isset($_SESSION["flash"])) { - $_custom_head .= ' + $_custom_head = ' - + @@ -92,7 +93,7 @@ custom_css; ?> - +
    @@ -100,7 +101,7 @@ <?php echo _AT('goto_content'); ?> ALT+c - <?php echo _AT('goto_menu'); ?> ALT+m + <?php echo _AT('goto_menu'); ?> ALT+m user_name)) @@ -203,13 +204,13 @@ - sub_level_pages) > 0): ?> + sub_level_pages) && count($this->sub_level_pages) > 0): ?>