[
https://issues.apache.org/jira/browse/JSPWIKI-662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12912881#action_12912881
]
Christian Lerch commented on JSPWIKI-662:
-----------------------------------------
Dirk, Harry,
thank you for responding that fast!
Well, I did some more investigations into this issue and found out that it is a
bit deeper rooted.
But first things first:
(1) The following 2 lines in jspwiki-common.js
var h = location.hostname;
this.BasePath = this.BaseUrl.slice(this.BaseUrl.indexOf(h)+h.length,-1);
are definitely defect. I hope you do agree, that slicing a valid BaseUrl that
DOES contain a port number, like
http://localhost:8080/mywiki/
by indexOf("localhost")+("localhost").length and -1
always fails to yield a correct BasePath (it results in something like
":8080/mywiki/"). Unforunately I'm unable to give an explanation why it still
works in your environment.
(2) I believe that "url-scheme's supported by JSPWiki" are not relevant at this
point, because we are talking about the BaseUrl from which the application is
served, and this always implies a http(s) url-scheme.
(3) I checked <meta name="wikiBaseUrl" .../> - as you suggested - and it
looked OK. Next I checked - again in jspwiki-common.js - the result of
$$('meta') and Ops!, it is empty when I use Firefox, but perfectly OK when
using IE8. Any explanations?
Next I replaced your minimized & obfuscated version of MooTools (mootools.js)
by a fresh download of the newest uncompressed version, and Bingo: now also
Firefox can retrieve the HTTP meta values through $$('meta').
(I'm currently using version <Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10>)
So, the big question is: What's going on here?
Christian
> JavaScript disabled in Firefox when BaseURL contains port number
> ----------------------------------------------------------------
>
> Key: JSPWIKI-662
> URL: https://issues.apache.org/jira/browse/JSPWIKI-662
> Project: JSPWiki
> Issue Type: Bug
> Components: Core & storage
> Affects Versions: 2.8.3
> Environment: Windows XP, Tomcat 6, Firefox 3.6
> Reporter: Christian Lerch
> Priority: Minor
>
> I think I've found a little bug in JSPWiki v2.8.3 which, interestingly
> enough, prevents Firefox 3.6 from running any JavaScript at all (it falls
> back into the <noscript> trap), when you use a BaseURL with a port number.
> IE8 on the other hand can't see any problems.
> The bug is in file jspwiki-commons.js near line 235 inside the anonymous
> onPageLoad function:
> ...
> /** 100 Wiki functions **/
> var Wiki = {
> onPageLoad: function(){
> ...
> Somewhere in there you try to figure out the BasePath from the BaseUrl by
> doing this:
> ...
> var h = location.hostname;
> this.BasePath = this.BaseUrl.slice(this.BaseUrl.indexOf(h)+h.length,-1);
> ...
> Which clearly will fail when you happen to have a BaseUrl with a port number.
> I've replaced these 2 lines by
> ...
> var href = location.href;
> this.BasePath = "/" + href.split("/")[3];
> ...
> which seems to work fine in all of my configurations.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.