** Output the given string with characters that are special to ** HTML escaped. */
| 11795 | ** HTML escaped. |
| 11796 | */ |
| 11797 | static void output_html_string(FILE *out, const char *z){ |
| 11798 | int i; |
| 11799 | if( z==0 ) z = ""; |
| 11800 | while( *z ){ |
| 11801 | for(i=0; z[i] |
| 11802 | && z[i]!='<' |
| 11803 | && z[i]!='&' |
| 11804 | && z[i]!='>' |
| 11805 | && z[i]!='\"' |
| 11806 | && z[i]!='\''; |
| 11807 | i++){} |
| 11808 | if( i>0 ){ |
| 11809 | utf8_printf(out,"%.*s",i,z); |
| 11810 | } |
| 11811 | if( z[i]=='<' ){ |
| 11812 | raw_printf(out,"<"); |
| 11813 | }else if( z[i]=='&' ){ |
| 11814 | raw_printf(out,"&"); |
| 11815 | }else if( z[i]=='>' ){ |
| 11816 | raw_printf(out,">"); |
| 11817 | }else if( z[i]=='\"' ){ |
| 11818 | raw_printf(out,"""); |
| 11819 | }else if( z[i]=='\'' ){ |
| 11820 | raw_printf(out,"'"); |
| 11821 | }else{ |
| 11822 | break; |
| 11823 | } |
| 11824 | z += i + 1; |
| 11825 | } |
| 11826 | } |
| 11827 | |
| 11828 | /* |
| 11829 | ** If a field contains any character identified by a 1 in the following |
no test coverage detected