From 3a563987be22b542a26c05b21a5691c9dd4ec7be Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Thu, 18 Nov 2010 18:43:03 -0600 Subject: Updating Output Profiler to validate xHTML Strict, and HTML5. --- system/libraries/Profiler.php | 49 +++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 25 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 4441a9fbe..e7d88b665 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -117,16 +117,16 @@ class CI_Profiler { // be modified. We also might want to make this data available to be logged $output = "\n\n"; - $output .= '
'; + $output .= '
'; $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_benchmarks').'  '; $output .= "\n"; - $output .= "\n\n\n"; + $output .= "\n\n
\n"; foreach ($profile as $key => $val) { $key = ucwords(str_replace(array('_', '-'), ' ', $key)); - $output .= "\n"; + $output .= "\n"; } $output .= "
".$key."  ".$val."
".$key."  ".$val."
\n"; @@ -158,12 +158,12 @@ class CI_Profiler { if (count($dbs) == 0) { $output = "\n\n"; - $output .= '
'; + $output .= '
'; $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_queries').'  '; $output .= "\n"; - $output .= "\n\n\n"; - $output .="\n"; + $output .= "\n\n
".$this->CI->lang->line('profiler_no_db')."
\n"; + $output .="\n"; $output .= "
".$this->CI->lang->line('profiler_no_db')."
\n"; $output .= "
"; @@ -184,11 +184,11 @@ class CI_Profiler { $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_database').':  '.$db->database.'   '.$this->CI->lang->line('profiler_queries').': '.count($this->CI->db->queries).'   '; $output .= "\n"; - $output .= "\n\n\n"; + $output .= "\n\n
\n"; if (count($db->queries) == 0) { - $output .= "\n"; + $output .= "\n"; } else { @@ -203,7 +203,7 @@ class CI_Profiler { $val = str_replace($bold, ''.$bold.'', $val); } - $output .= "\n"; + $output .= "\n"; } } @@ -226,7 +226,7 @@ class CI_Profiler { protected function _compile_get() { $output = "\n\n"; - $output .= '
'; + $output .= '
'; $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_get_data').'  '; $output .= "\n"; @@ -237,7 +237,7 @@ class CI_Profiler { } else { - $output .= "\n\n
".$this->CI->lang->line('profiler_no_queries')."
".$this->CI->lang->line('profiler_no_queries')."
".$time."  ".$val."
".$time."  ".$val."
\n"; + $output .= "\n\n
\n"; foreach ($_GET as $key => $val) { @@ -246,7 +246,7 @@ class CI_Profiler { $key = "'".$key."'"; } - $output .= "
$_GET[".$key."]   "; + $output .= "
$_GET[".$key."]   "; if (is_array($val)) { $output .= "
" . htmlspecialchars(stripslashes(print_r($val, true))) . "
"; @@ -275,7 +275,7 @@ class CI_Profiler { protected function _compile_post() { $output = "\n\n"; - $output .= '
'; + $output .= '
'; $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_post_data').'  '; $output .= "\n"; @@ -286,7 +286,7 @@ class CI_Profiler { } else { - $output .= "\n\n\n"; + $output .= "\n\n
\n"; foreach ($_POST as $key => $val) { @@ -295,7 +295,7 @@ class CI_Profiler { $key = "'".$key."'"; } - $output .= "
$_POST[".$key."]   "; + $output .= "
$_POST[".$key."]   "; if (is_array($val)) { $output .= "
" . htmlspecialchars(stripslashes(print_r($val, TRUE))) . "
"; @@ -324,7 +324,7 @@ class CI_Profiler { protected function _compile_uri_string() { $output = "\n\n"; - $output .= '
'; + $output .= '
'; $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_uri_string').'  '; $output .= "\n"; @@ -353,14 +353,13 @@ class CI_Profiler { protected function _compile_controller_info() { $output = "\n\n"; - $output .= '
'; + $output .= '
'; $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_controller_info').'  '; $output .= "\n"; $output .= "
".$this->CI->router->fetch_class()."/".$this->CI->router->fetch_method()."
"; - $output .= "
"; return $output; @@ -378,7 +377,7 @@ class CI_Profiler { protected function _compile_memory_usage() { $output = "\n\n"; - $output .= '
'; + $output .= '
'; $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_memory_usage').'  '; $output .= "\n"; @@ -409,17 +408,17 @@ class CI_Profiler { protected function _compile_http_headers() { $output = "\n\n"; - $output .= '
'; + $output .= '
'; $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_headers').'  '; $output .= "\n"; - $output .= "\n\n\n"; + $output .= "\n\n
\n"; foreach(array('HTTP_ACCEPT', 'HTTP_USER_AGENT', 'HTTP_CONNECTION', 'SERVER_PORT', 'SERVER_NAME', 'REMOTE_ADDR', 'SERVER_SOFTWARE', 'HTTP_ACCEPT_LANGUAGE', 'SCRIPT_NAME', 'REQUEST_METHOD',' HTTP_HOST', 'REMOTE_HOST', 'CONTENT_TYPE', 'SERVER_PROTOCOL', 'QUERY_STRING', 'HTTP_ACCEPT_ENCODING', 'HTTP_X_FORWARDED_FOR') as $header) { $val = (isset($_SERVER[$header])) ? $_SERVER[$header] : ''; - $output .= "\n"; + $output .= "\n"; } $output .= "
".$header."  ".$val."
".$header."  ".$val."
\n"; @@ -440,12 +439,12 @@ class CI_Profiler { protected function _compile_config() { $output = "\n\n"; - $output .= '
'; + $output .= '
'; $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_config').'  '; $output .= "\n"; - $output .= "\n\n\n"; + $output .= "\n\n
\n"; foreach($this->CI->config->config as $config=>$val) { @@ -454,7 +453,7 @@ class CI_Profiler { $val = print_r($val, TRUE); } - $output .= "\n"; + $output .= "\n"; } $output .= "
".$config."  ".htmlspecialchars($val)."
".$config."  ".htmlspecialchars($val)."
\n"; -- cgit v1.2.3-24-g4f1b