Fossil SCM
Do not attempt to render empty description of a report. Also make hyperlinks in a report's submenu more robust. This amends [fcf17b28a902c0].
Commit
04a01d066a84ba01b3afb215cd8022bd276646fc1106040ed82449b33471a7c1
Parent
e3c8aad9b12ac22…
1 file changed
+17
-8
+17
-8
| --- src/report.c | ||
| +++ src/report.c | ||
| @@ -586,13 +586,13 @@ | ||
| 586 | 586 | zTitle = mprintf("Copy Of %s", zTitle); |
| 587 | 587 | zOwner = g.zLogin; |
| 588 | 588 | } |
| 589 | 589 | } |
| 590 | 590 | if( zOwner==0 ) zOwner = g.zLogin; |
| 591 | - style_submenu_element("Cancel", "reportlist"); | |
| 591 | + style_submenu_element("Cancel", "%R/reportlist"); | |
| 592 | 592 | if( rn>0 ){ |
| 593 | - style_submenu_element("Delete", "rptedit/%d?del1=1", rn); | |
| 593 | + style_submenu_element("Delete", "%R/rptedit/%d?del1=1", rn); | |
| 594 | 594 | } |
| 595 | 595 | style_header("%s", rn>0 ? "Edit Report Format":"Create New Report Format"); |
| 596 | 596 | if( zErr ){ |
| 597 | 597 | @ <blockquote class="reportError">%h(zErr)</blockquote> |
| 598 | 598 | } |
| @@ -1192,34 +1192,43 @@ | ||
| 1192 | 1192 | db_multi_exec("PRAGMA empty_result_callbacks=ON"); |
| 1193 | 1193 | style_set_current_feature("report"); |
| 1194 | 1194 | if( pageWrap ) { |
| 1195 | 1195 | /* style_finish_page() should provide escaping via %h formatting */ |
| 1196 | 1196 | if( zQS[0] ){ |
| 1197 | - style_submenu_element("Raw","%R/%s?tablist=1&%s",g.zPath,zQS); | |
| 1197 | + if( g.zExtra && g.zExtra[0] ){ | |
| 1198 | + style_submenu_element("Raw","%R/%s/%s?tablist=1&%s", | |
| 1199 | + g.zPath, g.zExtra, zQS); | |
| 1200 | + }else{ | |
| 1201 | + style_submenu_element("Raw","%R/%s?tablist=1&%s",g.zPath,zQS); | |
| 1202 | + } | |
| 1198 | 1203 | style_submenu_element("Reports","%R/reportlist?%s",zQS); |
| 1199 | 1204 | } else { |
| 1200 | - style_submenu_element("Raw","%R/%s?tablist=1",g.zPath); | |
| 1205 | + if( g.zExtra && g.zExtra[0] ){ | |
| 1206 | + style_submenu_element("Raw","%R/%s/%s?tablist=1",g.zPath,g.zExtra); | |
| 1207 | + }else{ | |
| 1208 | + style_submenu_element("Raw","%R/%s?tablist=1",g.zPath); | |
| 1209 | + } | |
| 1201 | 1210 | style_submenu_element("Reports","%R/reportlist"); |
| 1202 | 1211 | } |
| 1203 | 1212 | if( g.perm.Admin |
| 1204 | 1213 | || (g.perm.TktFmt && g.zLogin && fossil_strcmp(g.zLogin,zOwner)==0) ){ |
| 1205 | - style_submenu_element("Edit", "rptedit/%d", rn); | |
| 1214 | + style_submenu_element("Edit", "%R/rptedit/%d", rn); | |
| 1206 | 1215 | } |
| 1207 | 1216 | if( g.perm.TktFmt ){ |
| 1208 | - style_submenu_element("SQL", "rptsql/%d",rn); | |
| 1217 | + style_submenu_element("SQL", "%R/rptsql/%d",rn); | |
| 1209 | 1218 | } |
| 1210 | 1219 | if( g.perm.NewTkt ){ |
| 1211 | 1220 | style_submenu_element("New Ticket", "%R/tktnew"); |
| 1212 | 1221 | } |
| 1213 | 1222 | style_header("%s", zTitle); |
| 1214 | 1223 | } |
| 1215 | - if( zDesc && zMimetype ){ | |
| 1224 | + if( zDesc && zDesc[0] && zMimetype ){ | |
| 1216 | 1225 | Blob src; |
| 1217 | 1226 | blob_init(&src, zDesc, -1); |
| 1218 | 1227 | wiki_render_by_mimetype(&src, zMimetype); |
| 1219 | 1228 | blob_reset(&src); |
| 1220 | - @ <p> | |
| 1229 | + @ <br> | |
| 1221 | 1230 | } |
| 1222 | 1231 | output_color_key(zClrKey, 1, |
| 1223 | 1232 | "border=\"0\" cellpadding=\"3\" cellspacing=\"0\" class=\"report\""); |
| 1224 | 1233 | @ <table border="1" cellpadding="2" cellspacing="0" class="report sortable" |
| 1225 | 1234 | @ data-column-types='' data-init-sort='0'> |
| 1226 | 1235 |
| --- src/report.c | |
| +++ src/report.c | |
| @@ -586,13 +586,13 @@ | |
| 586 | zTitle = mprintf("Copy Of %s", zTitle); |
| 587 | zOwner = g.zLogin; |
| 588 | } |
| 589 | } |
| 590 | if( zOwner==0 ) zOwner = g.zLogin; |
| 591 | style_submenu_element("Cancel", "reportlist"); |
| 592 | if( rn>0 ){ |
| 593 | style_submenu_element("Delete", "rptedit/%d?del1=1", rn); |
| 594 | } |
| 595 | style_header("%s", rn>0 ? "Edit Report Format":"Create New Report Format"); |
| 596 | if( zErr ){ |
| 597 | @ <blockquote class="reportError">%h(zErr)</blockquote> |
| 598 | } |
| @@ -1192,34 +1192,43 @@ | |
| 1192 | db_multi_exec("PRAGMA empty_result_callbacks=ON"); |
| 1193 | style_set_current_feature("report"); |
| 1194 | if( pageWrap ) { |
| 1195 | /* style_finish_page() should provide escaping via %h formatting */ |
| 1196 | if( zQS[0] ){ |
| 1197 | style_submenu_element("Raw","%R/%s?tablist=1&%s",g.zPath,zQS); |
| 1198 | style_submenu_element("Reports","%R/reportlist?%s",zQS); |
| 1199 | } else { |
| 1200 | style_submenu_element("Raw","%R/%s?tablist=1",g.zPath); |
| 1201 | style_submenu_element("Reports","%R/reportlist"); |
| 1202 | } |
| 1203 | if( g.perm.Admin |
| 1204 | || (g.perm.TktFmt && g.zLogin && fossil_strcmp(g.zLogin,zOwner)==0) ){ |
| 1205 | style_submenu_element("Edit", "rptedit/%d", rn); |
| 1206 | } |
| 1207 | if( g.perm.TktFmt ){ |
| 1208 | style_submenu_element("SQL", "rptsql/%d",rn); |
| 1209 | } |
| 1210 | if( g.perm.NewTkt ){ |
| 1211 | style_submenu_element("New Ticket", "%R/tktnew"); |
| 1212 | } |
| 1213 | style_header("%s", zTitle); |
| 1214 | } |
| 1215 | if( zDesc && zMimetype ){ |
| 1216 | Blob src; |
| 1217 | blob_init(&src, zDesc, -1); |
| 1218 | wiki_render_by_mimetype(&src, zMimetype); |
| 1219 | blob_reset(&src); |
| 1220 | @ <p> |
| 1221 | } |
| 1222 | output_color_key(zClrKey, 1, |
| 1223 | "border=\"0\" cellpadding=\"3\" cellspacing=\"0\" class=\"report\""); |
| 1224 | @ <table border="1" cellpadding="2" cellspacing="0" class="report sortable" |
| 1225 | @ data-column-types='' data-init-sort='0'> |
| 1226 |
| --- src/report.c | |
| +++ src/report.c | |
| @@ -586,13 +586,13 @@ | |
| 586 | zTitle = mprintf("Copy Of %s", zTitle); |
| 587 | zOwner = g.zLogin; |
| 588 | } |
| 589 | } |
| 590 | if( zOwner==0 ) zOwner = g.zLogin; |
| 591 | style_submenu_element("Cancel", "%R/reportlist"); |
| 592 | if( rn>0 ){ |
| 593 | style_submenu_element("Delete", "%R/rptedit/%d?del1=1", rn); |
| 594 | } |
| 595 | style_header("%s", rn>0 ? "Edit Report Format":"Create New Report Format"); |
| 596 | if( zErr ){ |
| 597 | @ <blockquote class="reportError">%h(zErr)</blockquote> |
| 598 | } |
| @@ -1192,34 +1192,43 @@ | |
| 1192 | db_multi_exec("PRAGMA empty_result_callbacks=ON"); |
| 1193 | style_set_current_feature("report"); |
| 1194 | if( pageWrap ) { |
| 1195 | /* style_finish_page() should provide escaping via %h formatting */ |
| 1196 | if( zQS[0] ){ |
| 1197 | if( g.zExtra && g.zExtra[0] ){ |
| 1198 | style_submenu_element("Raw","%R/%s/%s?tablist=1&%s", |
| 1199 | g.zPath, g.zExtra, zQS); |
| 1200 | }else{ |
| 1201 | style_submenu_element("Raw","%R/%s?tablist=1&%s",g.zPath,zQS); |
| 1202 | } |
| 1203 | style_submenu_element("Reports","%R/reportlist?%s",zQS); |
| 1204 | } else { |
| 1205 | if( g.zExtra && g.zExtra[0] ){ |
| 1206 | style_submenu_element("Raw","%R/%s/%s?tablist=1",g.zPath,g.zExtra); |
| 1207 | }else{ |
| 1208 | style_submenu_element("Raw","%R/%s?tablist=1",g.zPath); |
| 1209 | } |
| 1210 | style_submenu_element("Reports","%R/reportlist"); |
| 1211 | } |
| 1212 | if( g.perm.Admin |
| 1213 | || (g.perm.TktFmt && g.zLogin && fossil_strcmp(g.zLogin,zOwner)==0) ){ |
| 1214 | style_submenu_element("Edit", "%R/rptedit/%d", rn); |
| 1215 | } |
| 1216 | if( g.perm.TktFmt ){ |
| 1217 | style_submenu_element("SQL", "%R/rptsql/%d",rn); |
| 1218 | } |
| 1219 | if( g.perm.NewTkt ){ |
| 1220 | style_submenu_element("New Ticket", "%R/tktnew"); |
| 1221 | } |
| 1222 | style_header("%s", zTitle); |
| 1223 | } |
| 1224 | if( zDesc && zDesc[0] && zMimetype ){ |
| 1225 | Blob src; |
| 1226 | blob_init(&src, zDesc, -1); |
| 1227 | wiki_render_by_mimetype(&src, zMimetype); |
| 1228 | blob_reset(&src); |
| 1229 | @ <br> |
| 1230 | } |
| 1231 | output_color_key(zClrKey, 1, |
| 1232 | "border=\"0\" cellpadding=\"3\" cellspacing=\"0\" class=\"report\""); |
| 1233 | @ <table border="1" cellpadding="2" cellspacing="0" class="report sortable" |
| 1234 | @ data-column-types='' data-init-sort='0'> |
| 1235 |