Skip to main content

Bug Tracker

Side navigation

#946 closed enhancement (wontfix)

Opened February 12, 2007 03:33PM UTC

Closed May 16, 2008 02:38AM UTC

Occurrence of // in strings in jquery.js causes problems with idiotic JS-filters

Reported by: warp@spin.de Owned by:
Priority: major Milestone: 1.2.4
Component: core Version:
Keywords: Cc:
Blocked by: Blocking:
Description

Some German cell-phone internet providers obviously employ absolutely stupid transparent proxies which filter .js Files to decrease the download size and seem to cut off everything in JS sources after . jQuery's XPath Code contains the following line:

if ( !t.indexOf("") ) {

I wonder if this could maybe be rewritten to something like

if( !t.indexOf("/"+"/")) {

or maybe

if( !t.indexOf("//")) {

(I know, this is strictly speaking not a problem in jQuery itself, but it would be an easy work-around to not trigger such a filter. We already told the affected users to contact the cell phone provider, but it's not clear whether this will help)

Attachments (0)
Change History (3)

Changed March 21, 2007 07:31PM UTC by warp comment:1

The problem is worse than originally thought. Not only E-Plus filters Javascript this way, also Vodafone Germany does it.

Also, at least one other part of jQuery which is affected is the IE script defer hack:

document.write("<scr" + "ipt id=__ie_init defer=true " +

"src=//:></script>");

Changing src=: to src= seems to work around the problems.

This should _really_ be fixed in the standard distribution, especially as it's an easy to use fix which will avoid problems for many people.

Changed January 18, 2008 02:09AM UTC by Eli-D comment:2

Worthy to note, the defer hack is no longer used in bindReady().

The only instance of "//" I found is in ajax():

// If we're requesting a remote document
// and trying to load JSON or Script with a GET
if ( (!s.url.indexOf("http") || !s.url.indexOf("//")) && ( s.dataType == "script" || s.dataType =="json" ) && s.type.toLowerCase() == "get" ) {

Changed May 16, 2008 02:38AM UTC by flesler comment:3

description: Some German cell-phone internet providers obviously employ absolutely stupid transparent proxies which filter .js Files to decrease the download size and seem to cut off everything in JS sources after //. jQuery's XPath Code contains the following line:\ \ if ( !t.indexOf("//") ) {\ \ I wonder if this could maybe be rewritten to something like\ \ if( !t.indexOf("/"+"/")) {\ \ or maybe\ \ if( !t.indexOf("//")) {\ \ (I know, this is strictly speaking not a problem in jQuery itself, but it would be an easy work-around to not trigger such a filter. We already told the affected users to contact the cell phone provider, but it's not clear whether this will help)\ Some German cell-phone internet providers obviously employ absolutely stupid transparent proxies which filter .js Files to decrease the download size and seem to cut off everything in JS sources after //. jQuery's XPath Code contains the following line: \ \ if ( !t.indexOf("//") ) { \ \ I wonder if this could maybe be rewritten to something like \ \ if( !t.indexOf("/"+"/")) { \ \ or maybe \ \ if( !t.indexOf("//")) { \ \ (I know, this is strictly speaking not a problem in jQuery itself, but it would be an easy work-around to not trigger such a filter. We already told the affected users to contact the cell phone provider, but it's not clear whether this will help) \
milestone: → 1.2.4
need: → Review
resolution: → wontfix
status: newclosed

The ajax case is now gone, a regex is used which has a: '...\\/\\/...'.

As for the XPath, it's no longer supported.

This seems to be accidentally fixed.

Please reopen if you another occurrence of // and we'll see how to deal with it.