]> gitweb.ps.run Git - ps-cgit/commitdiff
Merge branch 'stable'
authorLars Hjemli <hjemli@gmail.com>
Mon, 30 May 2011 21:57:25 +0000 (23:57 +0200)
committerLars Hjemli <hjemli@gmail.com>
Mon, 30 May 2011 21:57:25 +0000 (23:57 +0200)
1  2 
html.c

diff --combined html.c
index 4a18a574e23cf8820997e0abc4111ac66e5d98e5,24a03a52b4042130a4da207ddafcfc370525658d..eb1c25db9b84665c2a23e3ab0a74930ffd81d458
--- 1/html.c
--- 2/html.c
+++ b/html.c
@@@ -138,7 -138,7 +138,7 @@@ void html_attr(const char *txt
        const char *t = txt;
        while(t && *t){
                int c = *t;
-               if (c=='<' || c=='>' || c=='\'' || c=='\"') {
+               if (c=='<' || c=='>' || c=='\'' || c=='\"' || c=='&') {
                        html_raw(txt, t - txt);
                        if (c=='>')
                                html("&gt;");
                                html("&#x27;");
                        else if (c=='"')
                                html("&quot;");
+                       else if (c=='&')
+                               html("&amp;");
                        txt = t+1;
                }
                t++;
@@@ -213,14 -215,6 +215,14 @@@ void html_option(const char *value, con
        html("</option>\n");
  }
  
 +void html_intoption(int value, const char *text, int selected_value)
 +{
 +      htmlf("<option value='%d'%s>", value,
 +            value == selected_value ? " selected='selected'" : "");
 +      html_txt(text);
 +      html("</option>");
 +}
 +
  void html_link_open(const char *url, const char *title, const char *class)
  {
        html("<a href='");