Menu

#1340 HTMLDocument::jsxSet_domain should handle "" domains

closed
RBRi
None
5
2012-10-21
2011-09-19
Patrick R
No

Currently HTMLDocument::jsxSet_domain(final String) forbids setting a new domain value if the previous domain was blank, "". The current block of code:
if (newDomain.indexOf('.') == -1
|| !currentDomain.toLowerCase().endsWith("." + newDomain.toLowerCase())) {
throw Context.reportRuntimeError("Illegal domain value, cannot set domain from: \""
+ currentDomain + "\" to: \"" + newDomain + "\"");
}

Why does a previous domain without a '.' forbid updating to a domain with a '.'? Could you at least add a currentDomain.length() != 0 && () to the check?

Discussion

  • Sam Barron

    Sam Barron - 2011-10-10

    I am also having an issue with this. The check as suggested would be a nice fix.

     
  • RBRi

    RBRi - 2011-10-11

    How do you create a page with an empty domain?

     
  • RBRi

    RBRi - 2012-10-05

    Now fixed in SVN. Thanks for reporting.

     

Log in to post a comment.