Opened 8 years ago

Closed 6 years ago

Last modified 6 years ago

#5042 closed Bug (fixed)

BaseHref Error

Reported by: Juanjo Aguilella Owned by:
Priority: Normal Milestone:
Component: General Version: 3.6.2
Keywords: IE Cc: dmachiavello@…

Description

Hi,

In first place, sorry for my english, it's not good.

The problem I'm facing is related with the baseHref functionality recently added to the config file for CKEDITOR.

I have two websites.

  • The first: www.mysite.com is a public site.
  • The second: cms.mysite.com is a cms web site.

The admin user accesses the administration pages through cms.mysite.com, but the uploaded files (images) are uploaded (on purpose) to the public site (www.site.com). Therefore, in the config file constructor I added the baseHref this way:

config.baseHref = "http://www.site.com/";

Ok. In Firefox it works as it is supossed to be, but in IE6, IE7 and IE8 it doesn't work in the HTML editor because the images path take the basepath of cms.site.com, ignoring the configuration. The stranger, is that right-clicking the image, in properties, the image is previewed correctly because it takes the basepath from the configuration (this is Ok).

Additionally, just to mention that I validated all that is written looking at the HTML generated using Firebug and checking the paths requested with Charles Debug Proxy too.

Change History (13)

comment:1 Changed 8 years ago by Frederico Caldeira Knabben

Keywords: WorksForMe IE added

I've just tested it with the following:

<textarea cols="80" id="editor1" name="editor1" rows="10">&lt;img src="intl/en_ALL/images/logo.gif" /&gt;</textarea>
<script type="text/javascript">
	CKEDITOR.replace( 'editor1',
		{
			baseHref : 'http://www.google.com/'
		});
</script>

The image gets loaded properly in IE.

Can you provide us a test case that shows the problem?

comment:2 in reply to:  1 Changed 8 years ago by bozojmdt

Replying to fredck:

I've just tested it with the following:

<textarea cols="80" id="editor1" name="editor1" rows="10">&lt;img src="intl/en_ALL/images/logo.gif" /&gt;</textarea>
<script type="text/javascript">
	CKEDITOR.replace( 'editor1',
		{
			baseHref : 'http://www.google.com/'
		});
</script>

The image gets loaded properly in IE.

Can you provide us a test case that shows the problem?

Hi,

I confirm. I've the same problem as Jaguilella. The example you give is ok with FF but not with IE6/7/8

comment:3 Changed 8 years ago by dmach27

Cc: dmachiavello@… added

I confirm this issue as well, but for me, it only fails IE 7 or less, IE 8 works fine for me (unless in compatibility mode)

This issue seems in IE7 puts in an absolute URL in the img's src in the editor, whereas in working browsers, the img src are relative (_cke_saved_src matches src).

Example of broken images (rendered html taken from IE dev tools):

<img style="width: 125px; float: right; height: 83px; margin-left: 5px; margin-right: 5px;" alt="" src="http://localhost/editables/view/images/flowers-test.jpg" _cke_saved_src="images/flowers-test.jpg"/>

Example of working images (rendered html taken from FF, using firebug)

<img style="width: 125px; float: right; height: 83px; margin-left: 5px; margin-right: 5px;" _cke_saved_src="images/flowers-test.jpg" src="images/flowers-test.jpg" alt="" _moz_resizing="true">

comment:4 Changed 8 years ago by dmach27

I forgot to mention, in IE7, this will work if you quick upload an image. Immediately following a quick upload, the dialog will show the image correctly in the preview, but as well as the editor.

The problem happens when the editor reads in images from previously saved data. (say i saved the html from the quick upload to a db, then come back, read in that saved html)

comment:5 Changed 8 years ago by Kassel1975

Version: 3.13.3

the same problem is discribed in ticket: https://dev.fckeditor.net/ticket/5283

comment:6 Changed 8 years ago by Alfonso Martínez de Lizarrondo

Version: 3.33.1

comment:7 Changed 8 years ago by Frederico Caldeira Knabben

Keywords: Confirmed added; WorksForMe removed

Confirmed with IE8 in compat mode.

comment:8 in reply to:  description Changed 7 years ago by Alejandro

I have the same problem. The images you see in Firefox and Chrome, but not in IE, just as you have described. Does not work on IE7 or IE8. The funny thing is that my level of development does not show images, but the web upload to the Internet if it works properly.

This ticket is said to be by the absence of doctype, but it's not my case http://dev.ckeditor.com/ticket/5816

comment:9 in reply to:  1 ; Changed 7 years ago by Alejandro

Replying to fredck: I think it's a bug. I can see the image with all browsers least IE7. Using the example of google image or a picture of me, the result is the same: image not shown. Has anyone found a solution? :(

I've just tested it with the following:

<textarea cols="80" id="editor1" name="editor1" rows="10">&lt;img src="intl/en_ALL/images/logo.gif" /&gt;</textarea>
<script type="text/javascript">
	CKEDITOR.replace( 'editor1',
		{
			baseHref : 'http://www.google.com/'
		});
</script>

The image gets loaded properly in IE.

Can you provide us a test case that shows the problem?

comment:10 in reply to:  9 Changed 7 years ago by Alejandro

Replying to andynedine: Do not know if will be, but when I enter a second time to the properties of the image, I returned a javascript error on the loss of focus, no window displays the properties of the image and I have the entire page gray, as in the background. Anyone else happens?

Replying to fredck: I think it's a bug. I can see the image with all browsers least IE7. Using the example of google image or a picture of me, the result is the same: image not shown. Has anyone found a solution? :(

I've just tested it with the following:

<textarea cols="80" id="editor1" name="editor1" rows="10">&lt;img src="intl/en_ALL/images/logo.gif" /&gt;</textarea>
<script type="text/javascript">
	CKEDITOR.replace( 'editor1',
		{
			baseHref : 'http://www.google.com/'
		});
</script>

The image gets loaded properly in IE.

Can you provide us a test case that shows the problem?

comment:11 Changed 6 years ago by Jakub Ś

Resolution: fixed
Status: confirmedclosed

I have checked this issue in latest CKEditor 3.6.2 and IE6-9 and was not able to reproduce this issue any more.

I have opened CKEditor in one domain and set config.baseHref = "http://www.site.com/";
Relative URLs were provided with dummy http://www.site.com/ prefix just as expected.

comment:12 in reply to:  11 Changed 6 years ago by dan seto

Version: 3.13.6.2

Replying to j.swiderski:

I have checked this issue in latest CKEditor 3.6.2 and IE6-9 and was not able to reproduce this issue any more.

I have opened CKEditor in one domain and set config.baseHref = "http://www.site.com/";
Relative URLs were provided with dummy http://www.site.com/ prefix just as expected.

This is still an issue in IE7.

IE is not respecting the base href value at all

comment:13 Changed 6 years ago by Jakub Ś

@abcito any chance for reproducible TC?

As I have written before I have checked this issue in CKEditor freshly downloaded from CKSource page and relative URL were joined with baseHref.

What is the exact way to reproduce the issue? What should I paste/write and where and what is the result I should look for. I may have missed something thus waiting for some to explain.

I have noticed that fix from #8602 has worked for you but does the issue occur in plain vanilla CKEditor of only when used in your application?

Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy