View Issue Details

IDProjectCategoryView StatusLast Update
0011927mantisbthtmlpublic2014-12-08 02:08
Reporterdhx Assigned Todhx  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.3.0dev 
Target Version1.3.0-beta.1 
Summary0011927: html_status_legend has code paths that forget to print closing table tags
Description

The html_status_legend function in html_api.php first prints opening table tags such as <table>. There are then code paths within the function that return without adding the closing </table> etc tags to the table. This causes rendering problems in browsers as the output HTML can be invalid.

Thanks to Kirill for reporting this issue.

Tagspatch
Attached Files
incorrect_table.patch (1,173 bytes)   
From e53d340983edae41565e70bc629a30e7e8c532be Mon Sep 17 00:00:00 2001
From: Kirill Krasnov <krasnovforum@gmail.com>
Date: Thu, 13 May 2010 10:16:07 +0300
Subject: [PATCH] Fix incorrect structure table if one of checks return true

---
 core/html_api.php |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/core/html_api.php b/core/html_api.php
index ab52334..5b7bf55 100644
--- a/core/html_api.php
+++ b/core/html_api.php
@@ -1273,10 +1273,6 @@ function print_summary_menu( $p_page = '' ) {
  * @return null
  */
 function html_status_legend() {
-	echo '<br />';
-	echo '<table class="status-legend width100" cellspacing="1">';
-	echo '<tr>';
-
 	# Don't show the legend if only one status is selected by the current filter
 	$t_current_filter = current_user_get_bug_filter();
 	if ( $t_current_filter === false ) {
@@ -1327,6 +1323,10 @@ function html_status_legend() {
 		return null;
 	}
 
+	echo '<br />';
+	echo '<table class="status-legend width100" cellspacing="1">';
+	echo '<tr>';
+
 	# draw the status bar
 	$width = (int)( 100 / count( $t_status_array ) );
 	foreach( $t_status_array as $t_status => $t_name ) {
-- 
1.7.1.msysgit.1

incorrect_table.patch (1,173 bytes)   

Relationships

related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 

Activities

grangeway

grangeway

2013-04-05 17:57

reporter   ~0036480

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch

govind

govind

2013-12-01 22:04

reporter   ~0038702

sdfgdf

govind

govind

2013-12-01 22:05

reporter   ~0038746

xdfjghjgh

Related Changesets

MantisBT: master 55ec936b

2010-05-13 03:16

Kirill Krasnov

Committer: dhx


Details Diff
Fix 0011927: html_status_legend has code paths that return invalid HTML

The html_status_legend function in html_api.php first prints opening table tags such as <table>. There are then code paths within the function that return without adding the closing </table> etc tags to the table. This causes rendering problems in browsers as the output HTML can be invalid.

Signed-off-by: David Hicks <hickseydr@optusnet.com.au>
Affected Issues
0011927
mod - core/html_api.php Diff File