Opened 14 years ago

Closed 14 years ago

Last modified 12 years ago

#545 closed defect (fixed)

ContentPane.js

Reported by: anonymous Owned by: bill
Priority: high Milestone:
Component: Widgets Version: 0.2
Keywords: Cc:
Blocked By: Blocking:

Description

ContentPane?.js from nightly build has a few bugs in splitAndFixPaths.

  1. attr = tag.match(/ (src|href|style)=(['"]?)([>]+)2[>]*>/i);

seems to me the third grouping should stop matching when the attribute is closed, currently is matches to the end of the tag. The third grouping is passed to dojo.uri.Uri which may react badly if passed something like "/path/index.html' id='bla'"

case "href":

if(attr[3].search(/(https?|ftps?|file):/)==-1){

fixedPath = (new dojo.uri.Uri(url, attr[3]).toString());

}

In order to cover the http and kin links, I think should be something like: case "href":

if(attr[3].search(/(https?|ftps?|file):/)==-1){

fixedPath = (new dojo.uri.Uri(url, attr[3]).toString());

} else {

fixedPath = attr[3]

}

regex = " " + attr[1] + "=" + attr[2] + attr[3] + attr[2]; fix = " " + attr[1] + "=" + attr[2] + fixedPath + attr[2]; pos2 = tag.search(new RegExp?(regex));

regex needs to escaped for special regular expression characters. Otherswise things like "onclick=func(this);" will not be found because '(' and ')' are special characters.

Change History (3)

comment:1 Changed 14 years ago by alex

Milestone: 0.3release
Owner: changed from anonymous to bill

These look like straightforward fixes. Do we know who submitted them?

comment:2 Changed 14 years ago by bill

Resolution: fixed
Status: newclosed

Fixed in #3357.

comment:3 Changed 12 years ago by (none)

Milestone: 0.3release

Milestone 0.3release deleted

Note: See TracTickets for help on using tickets.