Show
Ignore:
Timestamp:
2007-12-04 13:26:38 (10 months ago)
Author:
fredck
Message:

Fixed #294 : The HtmlEncodeOutput setting is enforced by the editor component, to avoid having to set ValidateRequest="false" on pages using the editor.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor.Net/trunk/FCKeditor.cs

    r1167 r1172  
    321321                } 
    322322 
     323                [Category( "Configurations" )] 
     324                public bool HtmlEncodeOutput 
     325                { 
     326                        set { this.Config[ "HtmlEncodeOutput" ] = ( value ? "true" : "false" ); } 
     327                } 
     328 
    323329                #endregion 
    324330 
     
    446452                public bool LoadPostData(string postDataKey, System.Collections.Specialized.NameValueCollection postCollection) 
    447453                { 
    448                         if ( postCollection[postDataKey] != this.Value ) 
    449                         { 
    450                                 this.Value = postCollection[postDataKey] ; 
     454                        string postedValue = postCollection[postDataKey] ; 
     455 
     456                        // Revert the HtmlEncodeOutput changes. 
     457                        if ( this.Config["HtmlEncodeOutput"] != "false" ) 
     458                        { 
     459                                postedValue = postedValue.Replace( "&", "&" ) ; 
     460                                postedValue = postedValue.Replace( "&lt;", "<" ) ; 
     461                                postedValue = postedValue.Replace( "&gt;", ">" ) ; 
     462                        } 
     463 
     464                        if ( postedValue != this.Value ) 
     465                        { 
     466                                this.Value = postedValue ; 
    451467                                return true ; 
    452468                        }