<div>Small test suite, should be tested with port and different domains... maybe port isn't neccesary, I'm not sure.</div>
<div> </div>
<div>Please test, thanks
</div>
<div><span class="gmail_quote">On 5/13/08, <b class="gmail_sendername">Ariel Flesler</b> <<a href="mailto:aflesler@gmail.com">
aflesler@gmail.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
Thanks for the comments.
I now realize the '//' was ok, it was past midnight you know... :)
So.. I'll push it in when I get some time (today for sure). I think a
regex will be clearer.
if( /^(http:)?\/\//.test(s.url) && ..... )
Thanks
--
Ariel Flesler
<a href="http://flesler.blogspot.com">
http://flesler.blogspot.com</a>On 13 mayo, 07:21, Wizzud <<a href="mailto:r...@wizzud.com">
r...@wizzud.com</a>> wrote:
> I'm definitely no expert (at anything!) but it seems to me that the
> sole intent of that test is to catch 'off-site' script gets, by
> checking that the url begins with either 'http' or '//', and is a
> script get.
> Ariel's change modifies the test to be : begins with 'http' or '/',
> and does not have the requesting host in it (preceded by '/'), and is
> a script get.
> Unfortunately this would also grab all 'on-site' root-relative urls,
> eg '/myroot/myscripts/script.js', which might not be desirable.
>
> As slight adjustment *might* be simply to reinstate the current double
> slash check back into Ariel's proposal (in place of the single slash
> check), ie:
> - begins with 'http' or '//' (indicating a full url, with/without
> protocol), and
> - does not contain '/'+[requesting host] (indicating 'off-site'), and
> - is a script get
>
> if ( (!s.url.indexOf("http") || !s.url.indexOf("//")) &&
> s.url.indexOf("/"+location.host) < 0
> && s.dataType == "script" && s.type.toLowerCase() == "get" ) {
>
> On May 13, 7:22 am, David Serduke <<a href="mailto:davidserd...@gmail.com">
davidserd...@gmail.com</a>> wrote:
>
>
>
> > I'm not an url expert either but the // part was added for this ticket
>
> ><a href="http://dev.jquery.com/ticket/1750">
http://dev.jquery.com/ticket/1750</a>>
> > it is of course possible another case exists that should be fixed.
>
> > David
>
> > On May 12, 8:49 pm, Ariel Flesler <<a href="mailto:afles...@gmail.com">
afles...@gmail.com</a>> wrote:
>
> > > I'm not an url expert, but I think this could be the fix.
>
> > ><a href="http://dev.jquery.com/ticket/2816">
http://dev.jquery.com/ticket/2816</a>>
> > > Thanks
>
> > > --
> > > Ariel Flesler
http://flesler.blogspot.com- Ocultar texto de la cita -
>
> - Mostrar texto de la cita -
<br clear="all">
--
Ariel Flesler
<a href="http://flesler.blogspot.com">
http://flesler.blogspot.com</a>