Ticket #668 (closed defect: fixed)

Opened 7 years ago

Last modified 6 years ago

incorect image src handling when switching html<->WYSIWYG

Reported by: RBW Owned by: gogo
Priority: normal Milestone:
Component: Xinha Core Version: trunk
Severity: normal Keywords:
Cc:

Description

After inserting image and then swithing html/WYSIWYG modes, the path of the image becomes incorect.

Before insertion: &lt;img height="60" alt="default.gif" src="test_img/default.gif" width="120" /&gt;

Behaviour in IE After switching view modes it becomes &lt;img height="60" alt="default.gif" src="xinha/test_img/default.gif" width="120" /&gt; Then each change between WYSIWYG and html modes adds "xinha/" to the begining of the src string: &lt;img height="60" alt="default.gif" src="xinha/xinha/test_img/default.gif" width="120" /&gt;

Behaviour in mozilla After switching view modes it becomes &lt;img height="60" alt="default.gif" src="xinha/xinha/plugins/ImageManager/../../../test_img/default.gif" width="120" /&gt; and remains as such

The thing that solved this problem was to change htmlarea.js line 4375: baseRe = new RegExp?(document.location.href.replace(/([\/]*\/?)$/, ).replace(HTMLArea.RE_Specials, '\\$1'), 'g'); to baseRe = new RegExp?(document.location.href.replace(HTMLArea.RE_Specials, '\\$1'), 'g');

Change History

Changed 7 years ago by RBW

After inserting image and then swithing html/WYSIWYG modes, the path of the image becomes incorect.

Before insertion: <img height="60" alt="default.gif" src="test_img/default.gif" width="120" />

Behaviour in IE After switching view modes it becomes <img height="60" alt="default.gif" src="xinha/test_img/default.gif" width="120" /> Then each change between WYSIWYG and html modes adds "xinha/" to the begining of the src string: <img height="60" alt="default.gif" src="xinha/xinha/test_img/default.gif" width="120" />

Behaviour in mozilla After switching view modes it becomes <img height="60" alt="default.gif" src="xinha/xinha/plugins/ImageManager/../../../test_img/default.gif" width="120" /> and remains as such

The thing that solved this problem was to change htmlarea.js line 4375: baseRe = new RegExp(document.location.href.replace(/([^\/]*\/?)$/, '').replace(HTMLArea.RE_Specials, '\\$1'), 'g'); to baseRe = new RegExp(document.location.href.replace(HTMLArea.RE_Specials, '\\$1'), 'g');

Changed 6 years ago by ray

  • status changed from new to closed
  • resolution set to fixed

There have been quite some changes on this part of the code, so I suppose this to fixed in the meantime

Note: See TracTickets for help on using tickets.