From 42191db50925312409a8d5d9f3b5f38fafa50f03 Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 20 Apr 2016 17:37:46 -0700 Subject: [PATCH] Poll notice removal. --- e107_handlers/db_debug_class.php | 30 +++++++++++++++--------------- e107_plugins/poll/poll_class.php | 21 +++++++++++++++------ 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/e107_handlers/db_debug_class.php b/e107_handlers/db_debug_class.php index 94b31c0b1..73280d6aa 100644 --- a/e107_handlers/db_debug_class.php +++ b/e107_handlers/db_debug_class.php @@ -72,25 +72,22 @@ class e107_db_debug { $this->ShowIf('Shortcodes / BBCode',$this->Show_SC_BB()); $this->ShowIf('Paths', $this->Show_PATH()); $this->ShowIf('Deprecated Function Usage', $this->Show_DEPRECATED()); + if(E107_DBG_INCLUDES) { $this->aIncList = get_included_files(); - } + } + $this->ShowIf('Included Files: '.count($this->aIncList), $this->Show_Includes()); } function ShowIf($title,$str) { - global $ns,$style; - $style='debug'; - - if (!isset($ns)) { - echo "Why did ns go away?
"; - $ns = new e107table; - } - - if (strlen($str)) { - $ns->tablerender($title, $str); + + if(!empty($str)) + { + e107::getRender()->setStyle('debug'); + e107::getRender()->tablerender($title, $str); } } @@ -683,8 +680,10 @@ class e107_db_debug { } } - function Show_Log(){ - if (!E107_DBG_BASIC || !count($this->aLog)){ + function Show_Log() + { + if (empty($this->aLog)) + { return FALSE; } // @@ -697,8 +696,9 @@ class e107_db_debug { foreach ($this->aLog as $curLog) { - if (!$bRowHeaders) { - $bRowHeaders=TRUE; + if (!$bRowHeaders) + { + $bRowHeaders = true; $text .= "".implode("", array_keys($curLog))."\n"; } diff --git a/e107_plugins/poll/poll_class.php b/e107_plugins/poll/poll_class.php index 014a255bb..ceaf9c93f 100644 --- a/e107_plugins/poll/poll_class.php +++ b/e107_plugins/poll/poll_class.php @@ -41,14 +41,23 @@ class poll function remove_poll_cookies() { $arr_polls_cookies = array(); - foreach($_COOKIE as $cookie_name => $cookie_val) - { // Collect poll cookies - list($str, $int) = explode('_', $cookie_name, 2); - if (($str == 'poll') && is_numeric($int)) - { // Yes, its poll's cookie - $arr_polls_cookies[] = $int; + if(!empty($_COOKIE)) + { + foreach($_COOKIE as $cookie_name => $cookie_val) + { // Collect poll cookies + + if(substr($cookie_name,0,5) == 'poll_') + { + // e107::getDebug()->log("Poll: ".$cookie_name); + list($str, $int) = explode('_', $cookie_name, 2); + if (($str == 'poll') && is_numeric($int)) + { // Yes, its poll's cookie + $arr_polls_cookies[] = $int; + } + } } } + if (count($arr_polls_cookies) > 1) { // Remove all except first (assumption: there is always only one active poll) rsort($arr_polls_cookies);