Diff for /parser3/src/classes/op.C between versions 1.174 and 1.176

version 1.174, 2008/02/14 09:10:23 version 1.176, 2008/05/15 09:34:32
Line 102  static void _if(Request& r, MethodParams Line 102  static void _if(Request& r, MethodParams
                 r.write_pass_lang(r.process(*params.get(2)));                  r.write_pass_lang(r.process(*params.get(2)));
 }  }
   
 static void _untaint(Request& r, MethodParams& params) {  static String::Language get_untaint_lang(MethodParams& params, int index){
           const String& lang_name=params.as_string(index, "lang must be string");
           String::Language lang=untaint_lang_name2enum.get(lang_name);
           if(!lang)
                   throw Exception(0,
                           &lang_name,
                           "invalid taint language");
           return lang;
   }
   
   static void _untaint(Request& r, MethodParams& params) {
         String::Language lang;          String::Language lang;
         if(params.count()==1)          if(params.count()==1)
                 lang=String::L_AS_IS; // mark as simply 'tainted'. useful in html from sql                   lang=String::L_AS_IS; // mark as simply 'as-is'. useful in html from sql 
         else {          else
                 const String& lang_name=params.as_string(0, "lang must be string");                  lang=get_untaint_lang(params, 0);
                 lang=untaint_lang_name2enum.get(lang_name);  
                 if(!lang)  
                         throw Exception(0,  
                                 &lang_name,  
                                 "invalid taint language");  
         }  
   
         {          {
                 Value& vbody=params.as_junction(params.count()-1, "body must be code");                  Value& vbody=params.as_junction(params.count()-1, "body must be code");
Line 127  static void _untaint(Request& r, MethodP Line 130  static void _untaint(Request& r, MethodP
 static void _taint(Request& r, MethodParams& params) {  static void _taint(Request& r, MethodParams& params) {
         String::Language lang;          String::Language lang;
         if(params.count()==1)          if(params.count()==1)
                 lang=String::L_TAINTED; // mark as simply 'tainted'. useful in table:set                  lang=String::L_TAINTED; // mark as simply 'tainted'. useful in table:create
         else {          else
                 const String& lang_name=params.as_string(0, "lang must be string");                  lang=get_untaint_lang(params, 0);
                 lang=untaint_lang_name2enum.get(lang_name);  
                 if(!lang)  
                         throw Exception(0,  
                                 &lang_name,  
                                 "invalid taint language");  
         }  
   
         {          {
                 Value& vbody=params.as_no_junction(params.count()-1, "body must not be code");                  Value& vbody=params.as_no_junction(params.count()-1, "body must not be code");
Line 268  static void _while(Request& r, MethodPar Line 265  static void _while(Request& r, MethodPar
                 if(delim_maybe_code && s_processed && s_processed->length()) { // delimiter set and we have body                  if(delim_maybe_code && s_processed && s_processed->length()) { // delimiter set and we have body
                         if(need_delim) // need delim & iteration produced string?                          if(need_delim) // need delim & iteration produced string?
                                 r.write_pass_lang(r.process(*delim_maybe_code));                                  r.write_pass_lang(r.process(*delim_maybe_code));
                         need_delim=true;                          else
                                   need_delim=true;
                 }                  }
                 r.write_pass_lang(sv_processed);                  r.write_pass_lang(sv_processed);
   
Line 329  static void _for(Request& r, MethodParam Line 327  static void _for(Request& r, MethodParam
                 if(delim_maybe_code && s_processed && s_processed->length()) { // delimiter set and we have body                  if(delim_maybe_code && s_processed && s_processed->length()) { // delimiter set and we have body
                         if(need_delim) // need delim & iteration produced string?                          if(need_delim) // need delim & iteration produced string?
                                 r.write_pass_lang(r.process(*delim_maybe_code));                                  r.write_pass_lang(r.process(*delim_maybe_code));
                         need_delim=true;                          else
                                   need_delim=true;
                 }                  }
                 r.write_pass_lang(sv_processed);                  r.write_pass_lang(sv_processed);
   

Removed from v.1.174  
changed lines
  Added in v.1.176


E-mail: