From 06fa739406e5103298ca72fc67cc41f0f8c6b6f4 Mon Sep 17 00:00:00 2001 From: David Cox Jr Date: Wed, 25 Sep 2013 01:56:10 -0400 Subject: fix issue #2617 simply adds the $_FILES array to profiler output of POST data --- system/libraries/Profiler.php | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 9e9e7d08d..80130eb48 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -338,7 +338,7 @@ class CI_Profiler { ."\n" .'  '.$this->CI->lang->line('profiler_post_data')."  \n"; - if (count($_POST) === 0) + if (count($_POST) === 0 AND count($_FILES) === 0) { $output .= '
'.$this->CI->lang->line('profiler_no_post').'
'; } @@ -368,9 +368,29 @@ class CI_Profiler { $output .= "\n"; } + foreach ($_FILES as $key => $val) + { + if ( ! is_numeric($key)) + { + $key = "'".$key."'"; + } + + $output .= '$_FILES[' + .$key.']   '; + + if (is_array($val) OR is_object($val)) + { + $output .= '
'.htmlspecialchars(stripslashes(print_r($val, TRUE))).'
'; + } + + $output .= "\n"; + } + $output .= "\n"; } + + return $output.''; } -- cgit v1.2.3-24-g4f1b From abcb67c76ccb384ea213f9c4f42a392b15b3e15e Mon Sep 17 00:00:00 2001 From: David Cox Jr Date: Wed, 16 Oct 2013 14:43:52 -0400 Subject: req. changes: cleaned up conditionals added changelog note regarding profiler updated as per styleguide --- system/libraries/Profiler.php | 19 ++++--------------- user_guide_src/source/changelog.rst | 1 + 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 80130eb48..50ba1673f 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -307,10 +307,7 @@ class CI_Profiler { foreach ($_GET as $key => $val) { - if ( ! is_numeric($key)) - { - $key = "'".$key."'"; - } + is_int($key) OR $key = "'".$key."'"; $output .= '$_GET[' .$key.']   ' @@ -338,7 +335,7 @@ class CI_Profiler { ."\n" .'  '.$this->CI->lang->line('profiler_post_data')."  \n"; - if (count($_POST) === 0 AND count($_FILES) === 0) + if (count($_POST) === 0 && count($_FILES) === 0) { $output .= '
'.$this->CI->lang->line('profiler_no_post').'
'; } @@ -348,10 +345,7 @@ class CI_Profiler { foreach ($_POST as $key => $val) { - if ( ! is_numeric($key)) - { - $key = "'".$key."'"; - } + is_int($key) OR $key = "'".$key."'"; $output .= '$_POST[' .$key.']   '; @@ -370,10 +364,7 @@ class CI_Profiler { foreach ($_FILES as $key => $val) { - if ( ! is_numeric($key)) - { - $key = "'".$key."'"; - } + is_int($key) OR $key = "'".$key."'"; $output .= '$_FILES[' .$key.']   '; @@ -389,8 +380,6 @@ class CI_Profiler { $output .= "\n"; } - - return $output.''; } diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index a66fb265f..052624076 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -351,6 +351,7 @@ Release Date: Not Released - Database object names are now being displayed. - The sum of all queries running times in seconds is now being displayed. - Added support for displaying the HTTP DNT ("Do Not Track") header. + - Added support for displaying $_FILES. - :doc:`Migration Library ` changes include: -- cgit v1.2.3-24-g4f1b