id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
961,baseHref not correctly treated when stripping,gogo,gogo,"The <base> tag in html, and thus the baseHref config option are intended to take a full URL to the file.  That is, something like http://www.example.com/example.html 

However this is not correctly treated when stripping because the basename (filename) is not removed from the baseHref before the replacements are done, thus when using a full URL as a correct base href the stripping does not function.

I propose the following fix to fixRelativeLinks (XinhaCore.js)
{{{
    if ( typeof this.config.baseHref != 'undefined' && this.config.baseHref !== null )
    {
      baseRe = new RegExp( ""((href|src|background)=\"")("" + this.config.baseHref.replace(/\/[^\/]*$/, '/').replace( Xinha.RE_Specials, '\\$1' ) + "")"", 'g' );
    }
}}}

That is, we remove any basename (filename) portion of the baseHref, leaving the baseHref with a trailing slash.  

If the baseHref already has a trailing slash, it wouldn't be touched, so one could set the baseHref to a directory in this manner (I think that some people do this, incorrectly).

Comments on this anybody?",defect,closed,normal,0.96,Xinha Core,trunk,major,fixed,,
