Ticket #668 (closed defect: fixed)
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: <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');
