/ Check-in [c8815fcd]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Modified shell to call output_html_string() for header values in .mode html. Updated output_html_string() to support the 5 basic HTML entities (<,>,&,',"). Ticket [dc3a6e5b31].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:c8815fcd88d17b2864e689c84eb8a63ef242ff04
User & Date: shane 2009-10-21 14:11:49
References
2009-10-21
14:09 Fixed ticket [dc3a6e5b]: Shell doesn't htmlify column headers plus 3 other changes artifact: 7cdb6d1d user: shane
Context
2009-10-21
14:33
Merge accidental fork back to trunk. check-in: f63397ad user: shane tags: trunk
14:11
Modified shell to call output_html_string() for header values in .mode html. Updated output_html_string() to support the 5 basic HTML entities (<,>,&,',"). Ticket [dc3a6e5b31]. check-in: c8815fcd user: shane tags: trunk
13:53
Made detectSchemaProblem function and aSchemaTable array static. Ticket [6f8b0c5855]. check-in: c6f22f3e user: shane tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/shell.c.

1380
1381
1382
1383
1384
1385
1386

1387





1388
1389
1390
1391
1392
1393
1394






1395
1396
1397
1398
1399
1400
1401
....
1568
1569
1570
1571
1572
1573
1574
1575


1576
1577
1578
1579
1580
1581
1582
/*
** Output the given string with characters that are special to
** HTML escaped.
*/
static void output_html_string(FILE *out, const char *z){
  int i;
  while( *z ){

    for(i=0; z[i] && z[i]!='<' && z[i]!='&'; i++){}





    if( i>0 ){
      fprintf(out,"%.*s",i,z);
    }
    if( z[i]=='<' ){
      fprintf(out,"&lt;");
    }else if( z[i]=='&' ){
      fprintf(out,"&amp;");






    }else{
      break;
    }
    z += i + 1;
  }
}

................................................................................
      }
      break;
    }
    case MODE_Html: {
      if( p->cnt++==0 && p->showHeader ){
        fprintf(p->out,"<TR>");
        for(i=0; i<nArg; i++){
          fprintf(p->out,"<TH>%s</TH>",azCol[i]);


        }
        fprintf(p->out,"</TR>\n");
      }
      if( azArg==0 ) break;
      fprintf(p->out,"<TR>");
      for(i=0; i<nArg; i++){
        fprintf(p->out,"<TD>");







>
|
>
>
>
>
>







>
>
>
>
>
>







 







|
>
>







1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
....
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
/*
** Output the given string with characters that are special to
** HTML escaped.
*/
static void output_html_string(FILE *out, const char *z){
  int i;
  while( *z ){
    for(i=0;   z[i] 
            && z[i]!='<' 
            && z[i]!='&' 
            && z[i]!='>' 
            && z[i]!='\"' 
            && z[i]!='\'';
        i++){}
    if( i>0 ){
      fprintf(out,"%.*s",i,z);
    }
    if( z[i]=='<' ){
      fprintf(out,"&lt;");
    }else if( z[i]=='&' ){
      fprintf(out,"&amp;");
    }else if( z[i]=='>' ){
      fprintf(out,"&gt;");
    }else if( z[i]=='\"' ){
      fprintf(out,"&quot;");
    }else if( z[i]=='\'' ){
      fprintf(out,"&#39;");
    }else{
      break;
    }
    z += i + 1;
  }
}

................................................................................
      }
      break;
    }
    case MODE_Html: {
      if( p->cnt++==0 && p->showHeader ){
        fprintf(p->out,"<TR>");
        for(i=0; i<nArg; i++){
          fprintf(p->out,"<TH>");
          output_html_string(p->out, azCol[i]);
          fprintf(p->out,"</TH>\n");
        }
        fprintf(p->out,"</TR>\n");
      }
      if( azArg==0 ) break;
      fprintf(p->out,"<TR>");
      for(i=0; i<nArg; i++){
        fprintf(p->out,"<TD>");