Changeset 869


Ignore:
Timestamp:
07/29/07 10:20:34 (12 years ago)
Author:
gogo
Message:

ticket:1028 - automatically (attempt to) work around an issue with mod_security being
triggered because of the charset on our POST requests, revert back to using postback in
Linker ( changeset:837 )

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/XinhaCore.js

    r868 r869  
    59375937 *                             as argument                              
    59385938 */ 
     5939  
     5940// mod_security (an apache module which scans incoming requests for potential hack attempts) 
     5941// has a rule which triggers when it gets an incoming Content-Type with a charset 
     5942// see ticket:1028 to try and work around this, if we get a failure in a postback 
     5943// then Xinha._postback_send_charset will be set to false and the request tried again (once) 
     5944Xinha._postback_send_charset = true; 
    59395945Xinha._postback = function(url, data, handler) 
    59405946{ 
     
    59665972        } 
    59675973      } 
     5974      else if(Xinha._postback_send_charset) 
     5975      {         
     5976        Xinha._postback_send_charset = false; 
     5977        Xinha._postback(url,data,handler); 
     5978      } 
    59685979      else 
    59695980      { 
     
    59765987 
    59775988  req.open('POST', url, true); 
    5978   req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 
     5989  req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'+(Xinha._postback_send_charset ? '; charset=UTF-8' : '')); 
    59795990  //alert(content); 
    59805991  req.send(content); 
  • trunk/plugins/Linker/linker.js

    r837 r869  
    337337    if(linker.lConfig.backend) 
    338338    { 
    339       if(linker.lConfig.backend_data != null) 
    340       { 
    341         linker.lConfig.backend += (linker.lConfig.backend.indexOf("?") != -1) ? "&" : "?";   
    342         var param = []; 
    343         for ( var i in linker.lConfig.backend_data ) 
    344         { 
    345             param.push(i + '=' + encodeURIComponent(linker.lConfig.backend_data[i])); 
    346         } 
    347         linker.lConfig.backend += param.join("&"); 
    348       }   
    349  
    350339      //get files from backend 
    351       Xinha._getback(linker.lConfig.backend, 
     340      Xinha._postback(linker.lConfig.backend, 
     341                      linker.lConfig.backend_data,  
    352342                          function(txt) { 
    353343                            try { 
Note: See TracChangeset for help on using the changeset viewer.