Changeset 884 for trunk


Ignore:
Timestamp:
09/03/07 16:08:31 (12 years ago)
Author:
ray
Message:

#1069 Editor document URL prefixed to any href that only consists of URL parameters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/XinhaCore.js

    r881 r884  
    671671  this.stripBaseHref = true; 
    672672 
    673    /**  We can strip the url of the editor page from named links (eg <a href="#top">...</a>) 
    674    *  reason for this is that mozilla at least (and IE ?) prefixes location.href to any anchor 
    675    *  that don't have a url prefixing them<br /> 
     673   /**  We can strip the url of the editor page from named links (eg &lt;a href="#top"&gt;...&lt;/a&gt;) and links  
     674   *  that consist only of URL parameters (eg &lt;a href="?parameter=value"&gt;...&lt;/a&gt;) 
     675   *  reason for this is that browsers tend to prefixe location.href to any href that 
     676   *  that don't have a full url<br /> 
    676677   *  Default: <code>true</code> 
    677678   *  @type Boolean 
     
    50205021  if ( typeof this.config.stripSelfNamedAnchors != 'undefined' && this.config.stripSelfNamedAnchors ) 
    50215022  { 
    5022     var stripRe = new RegExp(Xinha.escapeStringForRegExp(document.location.href.replace(/&/g,'&amp;')) + '(#[^\'" ]*)', 'g'); 
    5023     html = html.replace(stripRe, '$1'); 
     5023    var stripRe = new RegExp("((href|src|background)=\")("+Xinha.escapeStringForRegExp(document.location.href.replace(/&/g,'&amp;')) + ')([#?][^\'" ]*)', 'g'); 
     5024    html = html.replace(stripRe, '$1$4'); 
    50245025  } 
    50255026 
Note: See TracChangeset for help on using the changeset viewer.